New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 406 for trunk/NEMO/OPA_SRC/DIA/diaptr.F90 – NEMO

Ignore:
Timestamp:
2006-03-20T17:05:53+01:00 (18 years ago)
Author:
opalod
Message:

nemo_v1_bugfix_025 : CT : correction of various bugs in the computation of the Poleward Heat Transport

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/OPA_SRC/DIA/diaptr.F90

    r392 r406  
    3737 
    3838   !! * Share Module variables 
    39    LOGICAL, PUBLIC ::   & !!! ** init namelist (namptr) ** 
    40       ln_diaptr = .FALSE.   !: Poleward transport flag (T) or not (F) 
    41    INTEGER, PUBLIC ::   &  !!: ** ptr namelist (namptr) ** 
    42       nf_ptr = 15           !: frequency of ptr computation 
    43    REAL(wp), PUBLIC, DIMENSION(jpj) ::   &   ! poleward transport 
    44       pht_adv, pst_adv,  &  !: heat and salt: advection 
    45       pht_ove, pst_ove,  &  !: heat and salt: overturning 
    46       pht_ldf, pst_ldf,  &  !: heat and salt: lateral diffusion 
    47       pht_eiv, pst_eiv      !: heat and salt: bolus advection 
     39   LOGICAL, PUBLIC ::       & !!! ** init namelist (namptr) ** 
     40      ln_diaptr = .FALSE.,  &  !: Poleward transport flag (T) or not (F) 
     41      ln_subbas = .FALSE.      !: Atlantic/Pacific/Indian basins calculation 
     42   INTEGER, PUBLIC ::       & !!: ** ptr namelist (namptr) ** 
     43      nf_ptr = 15              !: frequency of ptr computation 
     44   REAL(wp), PUBLIC, DIMENSION(jpj) ::   &   !!: poleward transport 
     45      pht_adv, pst_adv,     &  !: heat and salt: advection 
     46      pht_ove, pst_ove,     &  !: heat and salt: overturning 
     47      pht_ldf, pst_ldf,     &  !: heat and salt: lateral diffusion 
     48#if defined key_diaeiv 
     49      pht_eiv, pst_eiv,     &  !: heat and salt: bolus advection 
     50#endif 
     51      ht_atl,ht_ind,ht_pac, &  !: heat 
     52      st_atl,st_ind,st_pac     !: salt 
     53   REAL(wp),DIMENSION(jpi,jpj) ::   & 
     54      abasin,pbasin,ibasin     !: return function value 
     55      
    4856 
    4957   !! Module variables 
    5058   REAL(wp), DIMENSION(jpj,jpk) ::   &   
    51       tn_jk  , sn_jk  ,  &  ! "zonal" mean temperature and salinity 
    52       v_msf           ,  &  ! "meridional" Stream-Function 
     59      tn_jk  , sn_jk  ,  &  !: "zonal" mean temperature and salinity 
     60      v_msf_atl       ,  &  !: "meridional" Stream-Function 
     61      v_msf_glo       ,  &  !: "meridional" Stream-Function 
     62      v_msf_ipc       ,  &  !: "meridional" Stream-Function 
    5363#if defined key_diaeiv 
    54       v_msf_eiv       ,  &  ! bolus "meridional" Stream-Function 
    55 #endif 
    56       surf_jk_r             ! inverse of the ocean "zonal" section surface 
     64      v_msf_eiv       ,  &  !: bolus "meridional" Stream-Function 
     65#endif 
     66      surf_jk_r             !: inverse of the ocean "zonal" section surface 
    5767 
    5868   !! * Substitutions 
     
    190200  
    191201      p_fval(:,:) = 0.e0 
     202 
    192203      DO jk = 1, jpkm1 
    193204         DO jj = 2, jpjm1 
    194             DO ji = fs_2, fs_jpim1   ! Vector opt. 
    195                p_fval(jj,jk) = p_fval(jj,jk) + pva(ji,jj,jk) * tmask_i(ji,jj+1) * tmask_i(ji,jj) 
    196             END DO 
     205           DO ji = fs_2, fs_jpim1 
     206            p_fval(jj,jk) = p_fval(jj,jk) + pva(ji,jj,jk) * e1v(ji,jj) * fse3v(ji,jj,jk) & 
     207               &            * tmask_i(ji,jj+1) * tmask_i(ji,jj) 
     208           END DO 
    197209         END DO 
    198210      END DO 
    199       IF( lk_mpp)   THEN 
    200           ish(1) = jpj*jpk ; ish2(1)=jpj ; ish2(2)=jpk 
    201           zwork(:)= RESHAPE(p_fval, ish ) 
    202           CALL mpp_sum(zwork, jpj*jpk ) 
    203           p_fval(:,:)= RESHAPE(zwork,ish2) 
     211 
     212      IF(lk_mpp)   THEN 
     213         ish(1) = jpj*jpk ; ish2(1)=jpj ; ish2(2)=jpk 
     214         zwork(:)= RESHAPE(p_fval, ish ) 
     215         CALL mpp_sum(zwork, jpj*jpk ) 
     216         p_fval(:,:)= RESHAPE(zwork,ish2) 
    204217      END IF 
    205218 
     
    220233      !! History : 
    221234      !!   9.0  !  03-09  (G. Madec)  Original code 
     235      !!   9.0  !  06-01  (A. Biastoch)  Allow sub-basins computation 
    222236      !!---------------------------------------------------------------------- 
    223237      !! * arguments 
     
    246260      END DO 
    247261      p_fval(:,:) = p_fval(:,:) * 0.5 
    248       IF( lk_mpp)   THEN 
    249           ish(1) = jpj*jpk ; ish2(1)=jpj ; ish2(2)=jpk 
    250           zwork(:)= RESHAPE(p_fval, ish ) 
    251           CALL mpp_sum(zwork, jpj*jpk ) 
    252           p_fval(:,:)= RESHAPE(zwork,ish2) 
     262      IF(lk_mpp)   THEN 
     263         ish(1) = jpj*jpk ; ish2(1)=jpj ; ish2(2)=jpk 
     264         zwork(:)= RESHAPE(p_fval, ish ) 
     265         CALL mpp_sum(zwork, jpj*jpk ) 
     266         p_fval(:,:)= RESHAPE(zwork,ish2) 
    253267      END IF 
    254268 
     
    260274      !!                  ***  ROUTINE dia_ptr  *** 
    261275      !!---------------------------------------------------------------------- 
     276      !! * Moudules used 
     277      USE ioipsl 
     278 
    262279      !! * Argument 
    263280      INTEGER, INTENT(in) ::   kt   ! ocean time step index 
    264281 
    265282      !! * Local variables 
    266       INTEGER ::   jk               ! dummy loop 
     283      INTEGER ::   jk,jj,ji               ! dummy loop 
    267284      REAL(wp) ::    & 
    268285         zsverdrup,  &              ! conversion from m3/s to Sverdrup 
    269286         zpwatt,     &              ! conversion from W    to PW 
    270287         zggram                     ! conversion from g    to Pg 
    271       !!---------------------------------------------------------------------- 
    272       zsverdrup = 1.e-6 
    273       zpwatt    = 1.e-15 
    274       zggram    = 1.e-6 
    275  
    276       ! "zonal" mean temperature and salinity at V-points 
    277       tn_jk(:,:) = ptr_vtjk( tn(:,:,:) ) * surf_jk_r(:,:) 
    278       sn_jk(:,:) = ptr_vtjk( sn(:,:,:) ) * surf_jk_r(:,:) 
    279  
    280       ! "zonal" mean mass flux at V-points 
    281       v_msf(:,:) = ptr_vjk( vn(:,:,:) )  
     288 
     289      REAL(wp), DIMENSION(jpi,jpj,jpk) ::  & 
     290         v_atl , v_ipc,                    & 
     291         vt_atl, vt_pac, vt_ind,           & 
     292         vs_atl, vs_pac, vs_ind,           & 
     293         zv_eiv 
     294      CHARACTER (len=32) ::   & 
     295         clnam = 'subbasins.nc'                 
     296      INTEGER ::  itime,inum,ipi,ipj,ipk       ! temporary integer 
     297      INTEGER, DIMENSION (1) ::   istep 
     298      REAL(wp) ::    zdate0,zsecond,zdt        ! temporary scalars 
     299      REAL(wp), DIMENSION(jpidta,jpjdta) ::   & 
     300         zlamt, zphit, zdta             ! temporary workspace (NetCDF read) 
     301      REAL(wp), DIMENSION(jpk) ::   & 
     302         zdept                          ! temporary workspace (NetCDF read) 
     303      !!---------------------------------------------------------------------- 
     304 
     305      IF( kt == nit000 .OR. MOD( kt, nf_ptr ) == 0 )   THEN 
     306 
     307         zsverdrup = 1.e-6 
     308         zpwatt    = 1.e-15 
     309         zggram    = 1.e-6 
     310         ipi       = jpidta 
     311         ipj       = jpjdta 
     312         ipk       = 1 
     313         itime     = 1 
     314         zsecond   = 0.e0 
     315         zdate0    = 0.e0 
     316    
     317# if defined key_diaeiv 
     318         zv_eiv(:,:,:) = v_eiv(:,:,:) 
     319# else 
     320         zv_eiv(:,:,:) = 0.e0 
     321# endif 
     322 
     323         ! "zonal" mean temperature and salinity at V-points 
     324         tn_jk(:,:) = ptr_vtjk( tn(:,:,:) ) * surf_jk_r(:,:) 
     325         sn_jk(:,:) = ptr_vtjk( sn(:,:,:) ) * surf_jk_r(:,:) 
     326 
     327         !-------------------------------------------------------- 
     328         ! overturning calculation: 
     329  
     330         IF( ln_subbas ) THEN              ! Basins computation 
     331 
     332            IF( kt == nit000 ) THEN                ! load basin mask 
     333               itime = 1 
     334               ipi   = jpidta 
     335               ipj   = jpjdta 
     336               ipk   = 1 
     337               zdt   = 0.e0 
     338               istep = 0 
     339               clnam = 'subbasins.nc' 
     340 
     341               CALL flinopen(clnam,1,jpidta,1,jpjdta,.FALSE.,ipi,ipj, & 
     342                  &          ipk,zlamt,zphit,zdept,itime,istep,zdate0,zdt,inum) 
     343 
     344               ! get basins: 
     345               abasin (:,:) = 0.e0 
     346               pbasin (:,:) = 0.e0 
     347               ibasin (:,:) = 0.e0 
     348 
     349               ! Atlantic basin 
     350               CALL flinget(inum,'atlmsk',jpidta,jpjdta,1,itime,1,   & 
     351                  &         0,1,jpidta,1,jpjdta,zdta(:,:)) 
     352               DO jj = 1, nlcj                                 ! interior values 
     353                  DO ji = 1, nlci 
     354                     abasin (ji,jj) = zdta( mig(ji), mjg(jj) ) 
     355                  END DO 
     356               END DO 
     357 
     358               ! Pacific basin 
     359               CALL flinget(inum,'pacmsk',jpidta,jpjdta,1,itime,1,   & 
     360                  &         0,1,jpidta,1,jpjdta,zdta(:,:)) 
     361               DO jj = 1, nlcj                                 ! interior values 
     362                  DO ji = 1, nlci 
     363                     pbasin (ji,jj) = zdta( mig(ji), mjg(jj) ) 
     364                  END DO 
     365               END DO 
     366 
     367               ! Indian basin 
     368               CALL flinget(inum,'indmsk',jpidta,jpjdta,1,itime,1,   & 
     369                  &         0,1,jpidta,1,jpjdta,zdta(:,:)) 
     370               DO jj = 1, nlcj                                 ! interior values 
     371                  DO ji = 1, nlci 
     372                     ibasin (ji,jj) = zdta( mig(ji), mjg(jj) ) 
     373                  END DO 
     374               END DO 
     375 
     376               CALL flinclo(inum) 
     377 
     378            ENDIF 
     379 
     380            ! basin separation: 
     381            DO jj = 1, jpj 
     382               DO ji = 1, jpi 
     383                  ! basin separated velocity 
     384                  v_atl(ji,jj,:) = (vn(ji,jj,:)+zv_eiv(ji,jj,:))*abasin(ji,jj) 
     385                  v_ipc(ji,jj,:) = (vn(ji,jj,:)+zv_eiv(ji,jj,:))*(pbasin(ji,jj)+ibasin(ji,jj)) 
     386 
     387                  ! basin separated T times V on T points 
     388                  vt_ind(ji,jj,:) = tn(ji,jj,:) *                                 & 
     389                     &              ( (vn    (ji,jj,:) + vn    (ji,jj-1,:))*0.5   & 
     390                     &              + (zv_eiv(ji,jj,:) + zv_eiv(ji,jj-1,:))*0.5 )  
     391                  vt_atl(ji,jj,:) = vt_ind(ji,jj,:) * abasin(ji,jj) 
     392                  vt_pac(ji,jj,:) = vt_ind(ji,jj,:) * pbasin(ji,jj) 
     393                  vt_ind(ji,jj,:) = vt_ind(ji,jj,:) * ibasin(ji,jj) 
     394 
     395                  ! basin separated S times V on T points 
     396                  vs_ind(ji,jj,:) = sn(ji,jj,:) *                                 & 
     397                     &              ( (vn    (ji,jj,:) + vn    (ji,jj-1,:))*0.5   & 
     398                     &              + (zv_eiv(ji,jj,:) + zv_eiv(ji,jj-1,:))*0.5 )  
     399                  vs_atl(ji,jj,:) = vs_ind(ji,jj,:) * abasin(ji,jj) 
     400                  vs_pac(ji,jj,:) = vs_ind(ji,jj,:) * pbasin(ji,jj) 
     401                  vs_ind(ji,jj,:) = vs_ind(ji,jj,:) * ibasin(ji,jj) 
     402               END DO 
     403            END DO 
     404 
     405         ENDIF 
     406 
     407         ! horizontal integral and vertical dz  
     408         v_msf_glo(:,:) = ptr_vjk( vn(:,:,:) )  
    282409#if defined key_diaeiv 
    283       ! "zonal" mean bolus mass flux at V-points 
    284       v_msf_eiv(:,:) = ptr_vjk( v_eiv(:,:,:) )  
    285       ! Bolus "Meridional" Stream-Function 
    286       DO jk = jpkm1, 1 , -1 
    287          v_msf_eiv(:,jk) = v_msf_eiv(:,jk-1) + v_msf_eiv(:,jk) 
    288       END DO 
    289       v_msf_eiv(:,:) = v_msf_eiv(:,:) * zsverdrup 
    290 #endif 
    291  
    292       ! poleward transport: overturning component 
    293       pht_ove(:) = SUM( v_msf(:,:) * tn_jk(:,:), 2 )   ! SUM over jk 
    294       pst_ove(:) = SUM( v_msf(:,:) * sn_jk(:,:), 2 )   ! SUM over jk 
    295  
    296       ! conversion in PW and G g 
    297       zpwatt = zpwatt * rau0 * rcp 
    298       pht_adv(:) = pht_adv(:) * zpwatt 
    299       pht_ove(:) = pht_ove(:) * zpwatt 
    300       pht_ldf(:) = pht_ldf(:) * zpwatt 
    301       pht_eiv(:) = pht_eiv(:) * zpwatt 
    302       pst_adv(:) = pst_adv(:) * zggram 
    303       pst_ove(:) = pst_ove(:) * zggram 
    304       pst_ldf(:) = pst_ldf(:) * zggram 
    305       pst_eiv(:) = pst_eiv(:) * zggram 
    306  
    307       ! "Meridional" Stream-Function 
    308       DO jk = jpkm1, 1, -1 
    309          v_msf(:,jk) = v_msf(:,jk-1) + v_msf(:,jk) 
    310       END DO 
    311       v_msf(:,:) = v_msf(:,:) * zsverdrup 
    312  
    313       ! output 
    314       CALL dia_ptr_wri( kt ) 
     410         v_msf_eiv(:,:) = ptr_vjk( v_eiv(:,:,:) )  
     411#endif 
     412         IF( ln_subbas ) THEN 
     413            v_msf_atl(:,:) = ptr_vjk( v_atl(:,:,:) )  
     414            v_msf_ipc(:,:) = ptr_vjk( v_ipc(:,:,:) )  
     415            ht_atl(:) = SUM(ptr_vjk( vt_atl(:,:,:)),2 ) 
     416            ht_pac(:) = SUM(ptr_vjk( vt_pac(:,:,:)),2 ) 
     417            ht_ind(:) = SUM(ptr_vjk( vt_ind(:,:,:)),2 ) 
     418            st_atl(:) = SUM(ptr_vjk( vs_atl(:,:,:)),2 ) 
     419            st_pac(:) = SUM(ptr_vjk( vs_pac(:,:,:)),2 ) 
     420            st_ind(:) = SUM(ptr_vjk( vs_ind(:,:,:)),2 ) 
     421         ENDIF 
     422 
     423         ! poleward tracer transports:  
     424         ! overturning components: 
     425         pht_ove(:) = SUM( v_msf_glo(:,:) * tn_jk(:,:), 2 )   ! SUM over jk 
     426         pst_ove(:) = SUM( v_msf_glo(:,:) * sn_jk(:,:), 2 )   ! SUM over jk 
     427#if defined key_diaeiv 
     428         pht_eiv(:) = SUM( v_msf_eiv(:,:) * tn_jk(:,:), 2 )   ! SUM over jk 
     429         pst_eiv(:) = SUM( v_msf_eiv(:,:) * sn_jk(:,:), 2 )   ! SUM over jk 
     430#endif 
     431       
     432         ! conversion in PW and G g 
     433         zpwatt = zpwatt * rau0 * rcp 
     434         pht_adv(:) = pht_adv(:) * zpwatt   
     435         pht_ove(:) = pht_ove(:) * zpwatt 
     436         pht_ldf(:) = pht_ldf(:) * zpwatt 
     437         pst_adv(:) = pst_adv(:) * zggram 
     438         pst_ove(:) = pst_ove(:) * zggram 
     439         pst_ldf(:) = pst_ldf(:) * zggram 
     440#if defined key_diaeiv 
     441         pht_eiv(:) = pht_eiv(:) * zpwatt 
     442         pst_eiv(:) = pst_eiv(:) * zggram 
     443#endif 
     444         IF( ln_subbas ) THEN 
     445            ht_atl(:) = ht_atl(:) * zpwatt 
     446            ht_pac(:) = ht_pac(:) * zpwatt 
     447            ht_ind(:) = ht_ind(:) * zpwatt 
     448            st_atl(:) = st_atl(:) * zggram  
     449            st_pac(:) = st_pac(:) * zggram 
     450            st_ind(:) = st_ind(:) * zggram 
     451         ENDIF 
     452 
     453         ! "Meridional" Stream-Function 
     454         DO jk = 2,jpk  
     455            v_msf_glo(:,jk) = v_msf_glo(:,jk-1) + v_msf_glo(:,jk) 
     456         END DO 
     457         v_msf_glo(:,:) = v_msf_glo(:,:) * zsverdrup 
     458 
     459#if defined key_diaeiv 
     460         ! Bolus "Meridional" Stream-Function 
     461         DO jk = 2,jpk  
     462            v_msf_eiv(:,jk) = v_msf_eiv(:,jk-1) + v_msf_eiv(:,jk) 
     463         END DO 
     464         v_msf_eiv(:,:) = v_msf_eiv(:,:) * zsverdrup 
     465#endif 
     466 
     467         IF( ln_subbas ) THEN 
     468            DO jk = 2,jpk  
     469               v_msf_atl(:,jk) = v_msf_atl(:,jk-1) + v_msf_atl(:,jk) 
     470               v_msf_ipc(:,jk) = v_msf_ipc(:,jk-1) + v_msf_ipc(:,jk) 
     471            END DO 
     472            v_msf_atl(:,:) = v_msf_atl(:,:) * zsverdrup 
     473            v_msf_ipc(:,:) = v_msf_ipc(:,:) * zsverdrup 
     474         ENDIF 
     475 
     476         ! outputs 
     477         CALL dia_ptr_wri( kt ) 
     478 
     479      ENDIF 
     480 
     481      ! Close the file 
     482      IF( kt == nitend ) CALL histclo( numptr ) 
    315483 
    316484   END SUBROUTINE dia_ptr 
     
    333501      !!---------------------------------------------------------------------- 
    334502      !! * local declarations 
    335       REAL(wp), DIMENSION(jpi,jpj,jpk) ::   & 
    336          z_1             ! temporary workspace 
    337  
    338       NAMELIST/namptr/ ln_diaptr, nf_ptr 
     503      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   z_1         ! temporary workspace 
     504 
     505      NAMELIST/namptr/ ln_diaptr, ln_subbas, nf_ptr 
    339506      !!---------------------------------------------------------------------- 
    340507 
     
    351518         WRITE(numout,*) '          Namelist namptr : set ptr parameters' 
    352519         WRITE(numout,*) '             Switch for ptr diagnostic (T) or not (F) ln_diaptr = ', ln_diaptr 
     520         WRITE(numout,*) '             Atla/Paci/Ind basins computation         ln_subbas = ', ln_subbas 
    353521         WRITE(numout,*) '             Frequency of computation                    nf_ptr = ', nf_ptr 
    354522      ENDIF 
     
    383551 
    384552      !! * Save variables    
    385       INTEGER, SAVE ::   nhoridz, ndepidzt, ndepidzw   & 
    386           , ndex(1) 
     553      INTEGER, SAVE ::   nhoridz, ndepidzt, ndepidzw, ndex(1) 
    387554 
    388555      !! * Local variables 
     
    435602            DO ji = mi0(iline), mi1(iline)  
    436603               zphi(:) = gphiv(ji,:)         ! if iline is in the local domain 
     604               ! correct highest latitude for ORCA05 
     605               IF( jp_cfg == 05  ) zphi(jpj) = zphi(jpjm1) + (zphi(jpjm1)-zphi(jpj-2))/2. 
     606               IF( jp_cfg == 05  ) zphi(jpj) = MIN( zphi(jpj), 90.) 
     607 
    437608            END DO 
    438609            ! provide the correct zphi to all local domains 
     
    458629         CALL ymds2ju( nyear, nmonth, nday, 0.e0, zjulian ) 
    459630 
    460          CALL dia_nam( clhstnam, nwrite, 'diaptr' ) 
     631         CALL dia_nam( clhstnam, nf_ptr, 'diaptr' ) 
    461632         IF(lwp)WRITE( numout,*)" Name of diaptr NETCDF file ",clhstnam 
    462633 
     
    479650         !  Meridional Stream-Function (eulerian and bolus) 
    480651          
    481          CALL histdef( numptr, "zomsfglo", "Meridional Stream-Function: global","Sv" ,   & 
     652         CALL histdef( numptr, "zomsfglo", "Meridional Stream-Function: Global","Sv" ,   & 
    482653            1, jpj, nhoridz, jpk, 1, jpk, ndepidzw, 32, clop, zsto, zout ) 
     654         IF( ln_subbas ) THEN 
     655            CALL histdef( numptr, "zomsfatl", "Meridional Stream-Function: Atlantic","Sv" ,   & 
     656               1, jpj, nhoridz, jpk, 1, jpk, ndepidzw, 32, clop, zsto, zout ) 
     657            CALL histdef( numptr, "zomsfipc", "Meridional Stream-Function: Indo-Pacific","Sv" ,& 
     658               1, jpj, nhoridz, jpk, 1, jpk, ndepidzw, 32, clop, zsto, zout ) 
     659         ENDIF 
    483660 
    484661         !  Heat transport  
     
    490667         CALL histdef( numptr, "sophtove", "Overturning Heat Transport"    ,   & 
    491668            "PW",1, jpj, nhoridz, 1, 1, 1, -99, 32, clop, zsto, zout ) 
     669         IF( ln_subbas ) THEN 
     670            CALL histdef( numptr, "sohtatl", "Heat Transport Atlantic"      ,  & 
     671               "PW", 1, jpj, nhoridz, 1, 1, 1, -99, 32, clop, zsto, zout ) 
     672            CALL histdef( numptr, "sohtpac", "Heat Transport Pacific"      ,   & 
     673               "PW", 1, jpj, nhoridz, 1, 1, 1, -99, 32, clop, zsto, zout ) 
     674            CALL histdef( numptr, "sohtind", "Heat Transport Indic"      ,     & 
     675               "PW", 1, jpj, nhoridz, 1, 1, 1, -99, 32, clop, zsto, zout ) 
     676         ENDIF 
     677 
    492678 
    493679         !  Salt transport  
     
    509695            "Giga g/s", 1, jpj, nhoridz, 1, 1, 1, -99, 32, clop, zsto, zout ) 
    510696#endif 
     697         IF( ln_subbas ) THEN 
     698            CALL histdef( numptr, "sostatl", "Salt Transport Atlantic"      ,    & 
     699               "Giga g/s", 1, jpj, nhoridz, 1, 1, 1, -99, 32, clop, zsto, zout ) 
     700            CALL histdef( numptr, "sostpac", "Salt Transport Pacific"      ,     & 
     701               "Giga g/s", 1, jpj, nhoridz, 1, 1, 1, -99, 32, clop, zsto, zout ) 
     702            CALL histdef( numptr, "sostind", "Salt Transport Indic"      ,       & 
     703               "Giga g/s", 1, jpj, nhoridz, 1, 1, 1, -99, 32, clop, zsto, zout ) 
     704         ENDIF 
     705          
    511706 
    512707         CALL histend( numptr ) 
     
    515710 
    516711      IF( MOD( kt, nf_ptr ) == 0 ) THEN 
     712 
     713         IF(lwp) THEN 
     714            WRITE(numout,*) 
     715            WRITE(numout,*) 'dia_ptr : write Poleward Transports at time-step : ', kt 
     716            WRITE(numout,*) '~~~~~~~~' 
     717            WRITE(numout,*) 
     718         ENDIF 
    517719 
    518720         ! define time axis 
    519721         it= kt - nit000 + 1 
    520          ndex(1) = 1 
     722         ndex(1) = 0 
    521723         CALL histwrite( numptr, "zotemglo", it, tn_jk    , jpj*jpk, ndex ) 
    522724         CALL histwrite( numptr, "zosalglo", it, sn_jk    , jpj*jpk, ndex ) 
    523          CALL histwrite( numptr, "zomsfglo", it, v_msf    , jpj*jpk, ndex ) 
    524          CALL histwrite( numptr, "sophtadv", it, pht_adv  , jpj    , ndex ) 
    525          CALL histwrite( numptr, "sophtldf", it, pht_ldf  , jpj    , ndex ) 
    526          CALL histwrite( numptr, "sophtove", it, pht_ove  , jpj    , ndex ) 
    527          CALL histwrite( numptr, "sopstadv", it, pst_adv  , jpj    , ndex ) 
    528          CALL histwrite( numptr, "sopstldf", it, pst_ldf  , jpj    , ndex ) 
    529          CALL histwrite( numptr, "sopstove", it, pst_ove  , jpj    , ndex ) 
     725         ! overturning outputs: 
     726         CALL histwrite( numptr, "zomsfglo", it, v_msf_glo , jpj*jpk, ndex ) 
     727         IF( ln_subbas ) THEN 
     728            CALL histwrite( numptr, "zomsfatl", it, v_msf_atl , jpj*jpk, ndex ) 
     729            CALL histwrite( numptr, "zomsfipc", it, v_msf_ipc , jpj*jpk, ndex ) 
     730         ENDIF 
     731         ! heat transport outputs: 
     732         IF( ln_subbas ) THEN 
     733            CALL histwrite( numptr, "sohtatl", it, ht_atl  , jpj, ndex ) 
     734            CALL histwrite( numptr, "sohtpac", it, ht_pac  , jpj, ndex ) 
     735            CALL histwrite( numptr, "sohtind", it, ht_ind  , jpj, ndex ) 
     736            CALL histwrite( numptr, "sostatl", it, st_atl  , jpj, ndex ) 
     737            CALL histwrite( numptr, "sostpac", it, st_pac  , jpj, ndex ) 
     738            CALL histwrite( numptr, "sostind", it, st_ind  , jpj, ndex ) 
     739         ENDIF 
     740 
     741         CALL histwrite( numptr, "sophtadv", it, pht_adv  , jpj, ndex ) 
     742         CALL histwrite( numptr, "sophtldf", it, pht_ldf  , jpj, ndex ) 
     743         CALL histwrite( numptr, "sophtove", it, pht_ove  , jpj, ndex ) 
     744         CALL histwrite( numptr, "sopstadv", it, pst_adv  , jpj, ndex ) 
     745         CALL histwrite( numptr, "sopstldf", it, pst_ldf  , jpj, ndex ) 
     746         CALL histwrite( numptr, "sopstove", it, pst_ove  , jpj, ndex ) 
    530747#if defined key_diaeiv 
    531748         CALL histwrite( numptr, "zomsfeiv", it, v_msf_eiv, jpj*jpk, ndex ) 
     
    536753      ENDIF 
    537754 
    538       ! Close the file 
    539       IF( kt == nitend )   CALL histclo( numptr )           ! Netcdf write 
    540  
    541755   END SUBROUTINE dia_ptr_wri 
    542756 
Note: See TracChangeset for help on using the changeset viewer.