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 4996 for trunk/NEMOGCM – NEMO

Changeset 4996 for trunk/NEMOGCM


Ignore:
Timestamp:
2014-12-22T12:56:38+01:00 (9 years ago)
Author:
cetlod
Message:

trunk : New diagnostics in PISCES model, see ticket #1424

Location:
trunk/NEMOGCM
Files:
28 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/EXP00/iodef.xml

    r4696 r4996  
    4646     <field field_ref="svoce"        name="vos"     long_name="sea_surface_y_velocity"    /> 
    4747   </file> 
    48     
     48 
     49        <file id="file4" name_suffix="_bioscalar" description="pisces sms variables" > 
     50          <field field_ref="tdenit"   name="tdenit"   unit="TgN/yr" operation="instant" > tdenit * 14. * 86400. * 365. / 1e12 </field> 
     51          <field field_ref="tnfix"    name="tnfix"    unit="TgN/yr" operation="instant" > tnfix * 14. * 86400. * 365. / 1e12 </field> 
     52          <field field_ref="tcflx"    name="tcflx"    unit="PgC/yr" operation="instant" > tcflx * -1. * 12. * 86400. * 365. / 1e15 </field> 
     53          <field field_ref="tcflxcum" name="tcflxcum" unit="PgC"    operation="instant" > tcflxcum * -1. * 12. / 1e15 </field> 
     54          <field field_ref="tcexp"    name="tcexp"    unit="PgC/yr" operation="instant" > tcexp * 12. * 86400. * 365. / 1e15 </field> 
     55          <field field_ref="tintpp"   name="tintpp"   unit="PgC/yr" operation="instant" > tintpp * 12. * 86400. * 365. / 1e15 </field> 
     56          <field field_ref="pno3tot"  name="pno3tot"  unit="umolN"  > pno3tot * 16. / 122. * 1e6 </field> 
     57          <field field_ref="psiltot"  name="psiltot"  unit="umolC"  > psiltot * 1e6  </field> 
     58          <field field_ref="palktot"  name="palktot"  unit="umolC"  > palktot * 1e6  </field> 
     59        <field field_ref="pfertot"  name="pfertot"  unit="nmolFe" > pfertot * 1e9  </field> 
     60                                                                                                                             </file> 
    4961      </file_group> 
    5062 
     
    5365      <file_group id="5d" output_freq="5d"  output_level="10" enabled=".TRUE.">  <!-- 5d files -->    
    5466 
    55    <file id="file4" name_suffix="_grid_T" description="ocean T grid variables" > 
     67   <file id="file5" name_suffix="_grid_T" description="ocean T grid variables" > 
    5668     <field field_ref="toce"         name="thetao"   long_name="sea_water_potential_temperature"               /> 
    5769     <field field_ref="soce"         name="so"       long_name="sea_water_salinity"                            /> 
     
    7284   </file> 
    7385    
    74    <file id="file5" name_suffix="_grid_U" description="ocean U grid variables" > 
     86   <file id="file6" name_suffix="_grid_U" description="ocean U grid variables" > 
    7587     <field field_ref="uoce"         name="uo"      long_name="sea_water_x_velocity"      /> 
    7688     <field field_ref="suoce"        name="uos"     long_name="sea_surface_x_velocity"    /> 
     
    8193   </file> 
    8294    
    83    <file id="file6" name_suffix="_grid_V" description="ocean V grid variables" > 
     95   <file id="file7" name_suffix="_grid_V" description="ocean V grid variables" > 
    8496     <field field_ref="voce"         name="vo"      long_name="sea_water_y_velocity"      /> 
    8597     <field field_ref="svoce"        name="vos"     long_name="sea_surface_y_velocity"    /> 
     
    90102   </file> 
    91103    
    92    <file id="file7" name_suffix="_grid_W" description="ocean W grid variables" > 
     104   <file id="file8" name_suffix="_grid_W" description="ocean W grid variables" > 
    93105     <field field_ref="woce"         name="wo"      long_name="ocean vertical velocity"         /> 
    94106     <field field_ref="avt"          name="difvho"  long_name="ocean_vertical_heat_diffusivity" /> 
    95107   </file> 
    96108    
    97    <file id="file8" name_suffix="_icemod" description="ice variables" > 
     109   <file id="file9" name_suffix="_icemod" description="ice variables" > 
    98110     <field field_ref="ice_pres"                     /> 
    99111     <field field_ref="snowthic_cea" name="snd"     long_name="surface_snow_thickness"   /> 
     
    114126      <file_group id="1m" output_freq="1mo" output_level="10" enabled=".TRUE."> <!-- real monthly files --> 
    115127 
    116    <file id="file9" name_suffix="_ptrc_T" description="pisces sms variables" > 
     128   <file id="file10" name_suffix="_ptrc_T" description="pisces sms variables" > 
    117129          <field field_ref="DIC"      /> 
    118130          <field field_ref="Alkalini" /> 
     
    126138   </file> 
    127139    
    128    <file id="file10" name_suffix="_diad_T" description="additional pisces diagnostics" > 
     140   <file id="file11" name_suffix="_diad_T" description="additional pisces diagnostics" > 
    129141          <field field_ref="Cflx"     /> 
    130142          <field field_ref="Dpco2"    /> 
     
    140152      <file_group id="1y"  output_freq="1y" output_level="10" enabled=".TRUE."> <!-- real yearly files --> 
    141153 
    142    <file id="file11" name_suffix="_ptrc_T" description="pisces sms variables" > 
     154   <file id="file12" name_suffix="_ptrc_T" description="pisces sms variables" > 
    143155          <field field_ref="DIC"      /> 
    144156          <field field_ref="Alkalini" /> 
     
    167179   </file> 
    168180 
    169    <file id="file12" name_suffix="_diad_T" description="additional pisces diagnostics" > 
     181   <file id="file13" name_suffix="_diad_T" description="additional pisces diagnostics" > 
    170182          <field field_ref="PH"       /> 
    171183          <field field_ref="CO3"      /> 
  • trunk/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/iodef.xml

    r4153 r4996  
    3030      <file_group id="6h" output_freq="6h"  output_level="10" enabled=".TRUE."/> <!-- 6h files --> 
    3131      
    32       <file_group id="1d" output_freq="1d"  output_level="10" enabled=".TRUE."/> <!-- 1d files --> 
     32      <file_group id="1d" output_freq="1d"  output_level="10" enabled=".TRUE."> <!-- 1d files --> 
     33        <file id="file1" name_suffix="_bioscalar" description="pisces sms variables" > 
     34           <field field_ref="tdenit"   name="tdenit"   unit="TgN/yr" operation="instant" > tdenit * 14. * 86400. * 365. / 1e12 </field> 
     35           <field field_ref="tnfix"    name="tnfix"    unit="TgN/yr" operation="instant" > tnfix * 14. * 86400. * 365. / 1e12 </field> 
     36           <field field_ref="tcflx"    name="tcflx"    unit="PgC/yr" operation="instant" > tcflx * -1. * 12. * 86400. * 365. / 1e15 </field> 
     37           <field field_ref="tcflxcum" name="tcflxcum" unit="PgC"    operation="instant" > tcflxcum * -1. * 12. / 1e15 </field> 
     38           <field field_ref="tcexp"    name="tcexp"    unit="PgC/yr" operation="instant" > tcexp * 12. * 86400. * 365. / 1e15 </field> 
     39           <field field_ref="tintpp"   name="tintpp"   unit="PgC/yr" operation="instant" > tintpp * 12. * 86400. * 365. / 1e15 </field> 
     40           <field field_ref="pno3tot"  name="pno3tot"  unit="umolN"  > pno3tot * 16. / 122. * 1e6 </field> 
     41           <field field_ref="psiltot"  name="psiltot"  unit="umolC"  > psiltot * 1e6  </field> 
     42           <field field_ref="palktot"  name="palktot"  unit="umolC"  > palktot * 1e6  </field> 
     43           <field field_ref="pfertot"  name="pfertot"  unit="nmolFe" > pfertot * 1e9  </field> 
     44        </file> 
     45      </file_group> 
     46 
    3347      <file_group id="3d" output_freq="3d"  output_level="10" enabled=".TRUE."/> <!-- 3d files -->     
    3448      <file_group id="5d" output_freq="5d"  output_level="10" enabled=".TRUE."/>  <!-- 5d files -->    
     
    3650      <file_group id="1m" output_freq="1mo" output_level="10" enabled=".TRUE."> <!-- real monthly files --> 
    3751 
    38    <file id="file1" name_suffix="_ptrc_T" description="pisces sms variables" > 
     52   <file id="file2" name_suffix="_ptrc_T" description="pisces sms variables" > 
    3953          <field field_ref="DIC"      /> 
    4054          <field field_ref="Alkalini" /> 
     
    4862   </file> 
    4963    
    50    <file id="file2" name_suffix="_diad_T" description="additional pisces diagnostics" > 
     64   <file id="file3" name_suffix="_diad_T" description="additional pisces diagnostics" > 
    5165          <field field_ref="Cflx"     /> 
    5266          <field field_ref="Dpco2"    /> 
     
    6175      <file_group id="1y"  output_freq="1y" output_level="10" enabled=".TRUE."> <!-- real yearly files --> 
    6276 
    63    <file id="file3" name_suffix="_ptrc_T" description="pisces sms variables" > 
     77   <file id="file4" name_suffix="_ptrc_T" description="pisces sms variables" > 
    6478          <field field_ref="DIC"      /> 
    6579          <field field_ref="Alkalini" /> 
     
    88102   </file> 
    89103 
    90    <file id="file4" name_suffix="_diad_T" description="additional pisces diagnostics" > 
     104   <file id="file5" name_suffix="_diad_T" description="additional pisces diagnostics" > 
    91105          <field field_ref="PH"       /> 
    92106          <field field_ref="CO3"      /> 
  • trunk/NEMOGCM/CONFIG/SHARED/field_def.xml

    r4990 r4996  
    599599       <field id="EPSI100"     long_name="Export of Silicate at 100 m"             unit="mol/m2/s"                     /> 
    600600       <field id="EPCAL100"    long_name="Export of Calcite at 100 m"              unit="mol/m2/s"                     /> 
     601       <field id="EXPC"        long_name="Export of carbon"                        unit="molC/m2/s"  grid_ref="grid_T_3D" /> 
     602       <field id="EXPFE"       long_name="Export of biogenic iron"                 unit="molFe/m2/s" grid_ref="grid_T_3D" /> 
     603       <field id="EXPSI"       long_name="Export of Silicate"                      unit="molSi/m2/s" grid_ref="grid_T_3D" /> 
     604       <field id="EXPCAL"      long_name="Export of Calcite"                       unit="molC/m2/s"  grid_ref="grid_T_3D" /> 
    601605       <field id="Cflx"        long_name="DIC flux"                                unit="mol/m2/s"                     /> 
    602606       <field id="Oflx"        long_name="Oxygen flux"                             unit="mol/m2/s"                     /> 
     
    608612       <field id="Ironsed"     long_name="Iron deposition from sediment"           unit="mol/m2/s"  grid_ref="grid_T_3D"/> 
    609613 
     614 
    610615       <!-- PISCES with Kriest parametisation : variables available with key_kriest --> 
    611        <field id="POCFlx"      long_name="Particulate organic C flux"              unit="mol/m2/s"   grid_ref="grid_T_3D" /> 
    612        <field id="NumFlx"      long_name="Particle number flux"                    unit="nbr/m2/s"   grid_ref="grid_T_3D" /> 
    613        <field id="SiFlx"       long_name="Biogenic Si flux"                        unit="mol/m2/s"   grid_ref="grid_T_3D" /> 
    614        <field id="CaCO3Flx"    long_name="CaCO3 flux"                              unit="mol/m2/s"   grid_ref="grid_T_3D" /> 
    615        <field id="xnum"        long_name="Number of particles in aggregats"        unit="-"          grid_ref="grid_T_3D" /> 
    616        <field id="W1"          long_name="sinking speed of mass flux"              unit="m2/s"       grid_ref="grid_T_3D" /> 
    617        <field id="W2"          long_name="sinking speed of number flux"            unit="m2/s"       grid_ref="grid_T_3D" /> 
     616       <field id="EPN100"      long_name="Particulate number flux at 100 m"        unit="mol/m2/s"                     /> 
     617       <field id="EXPN"        long_name="Particulate number flux"                 unit="mol/m2/s"   grid_ref="grid_T_3D" /> 
     618       <field id="XNUM"        long_name="Number of particles in aggregats"        unit="-"          grid_ref="grid_T_3D" /> 
     619       <field id="WSC"         long_name="sinking speed of mass flux"              unit="m2/s"       grid_ref="grid_T_3D" /> 
     620       <field id="WSN"         long_name="sinking speed of number flux"            unit="m2/s"       grid_ref="grid_T_3D" /> 
     621 
     622      <!-- dbio_T on T grid : variables available with key_diaar5 --> 
     623       <field id="TPP"         long_name="Total Primary production of phyto"                   unit="molC/m3/s"  grid_ref="grid_T_3D" /> 
     624       <field id="TPNEW"       long_name="New Primary production of phyto"                     unit="molC/m3/s"  grid_ref="grid_T_3D" /> 
     625       <field id="TPBFE"       long_name="Total biogenic iron production"                      unit="molFe/m3/s" grid_ref="grid_T_3D" /> 
     626       <field id="INTDIC"      long_name="DIC content"                                         unit="kg/m2"   /> 
     627       <field id="O2MIN"       long_name="Oxygen minimum concentration"                        unit="molC/L" /> 
     628       <field id="ZO2MIN"      long_name="Depth of oxygen minimum concentration"               unit="m"       /> 
     629       <field id="INTNFIX"     long_name="Nitrogen fixation rate : vert. integrated"           unit="molN/m2/s"  /> 
     630       <field id="INTPPPHY"    long_name="Vertically integrated primary production by nanophy" unit="molC/m2/s"  /> 
     631       <field id="INTPPPHY2"   long_name="Vertically integrated primary production by diatom"  unit="molC/m2/s"  /> 
     632       <field id="INTPP"       long_name="Vertically integrated primary production by phyto"   unit="molC/m2/s"  /> 
     633       <field id="INTPNEW"     long_name="Vertically integrated new primary production"        unit="molC/m2/s"  /> 
     634       <field id="INTPBFE"     long_name="Vertically integrated of biogenic iron production"   unit="molFe/m2/s" /> 
     635       <field id="INTPBSI"     long_name="Vertically integrated of biogenic Si production"     unit="molSi/m2/s" /> 
     636       <field id="INTPCAL"     long_name="Vertically integrated of calcite production"         unit="molC/m2/s" /> 
    618637 
    619638       <!-- PISCES light : variables available with key_pisces_reduced --> 
     
    647666       <field id="qintC14b"    long_name="Cumulative air-sea flux of Bomb C14"      unit="mol/m2"     /> 
    648667       <field id="fdecay"      long_name="Radiactive decay of Bomb C14"             unit="mol/m3"  grid_ref="grid_T_3D"  /> 
     668     </field_group> 
     669 
     670    <field_group id="PISCES_scalar"  domain_ref="1point" > 
     671       <field id="pno3tot"         long_name="global mean nitrate concentration"                  unit="mol/l"   /> 
     672       <field id="psiltot"         long_name="global mean silicate concentration"                 unit="mol/l"   /> 
     673       <field id="palktot"         long_name="global mean alkalinity concentration"               unit="mol/l"   /> 
     674       <field id="pfertot"         long_name="global mean iron concentration"                     unit="mol/l"   /> 
     675       <field id="tcflx"           long_name="total Flux of Carbon out of the ocean"              unit="molC/s" /> 
     676       <field id="tcflxcum"        long_name="cumulative total Flux of Carbon out of the ocean"   unit="molC/s" /> 
     677       <field id="tcexp"           long_name="total Carbon export at 100m"                        unit="molC/s" /> 
     678       <field id="tintpp"          long_name="global total integrated primary production"         unit="molC/s" /> 
     679       <field id="tnfix"           long_name="global total nitrogen fixation"                     unit="molN/s" /> 
     680       <field id="tdenit"          long_name="Total denitrification"                              unit="molN/s" /> 
    649681     </field_group> 
    650682 
  • trunk/NEMOGCM/NEMO/OFF_SRC/istate.F90

    r4569 r4996  
    1212   USE oce             ! ocean dynamics and active tracers  
    1313   USE dom_oce         ! ocean space and time domain  
    14    USE daymod          ! calendar 
    1514 
    1615   IMPLICIT NONE 
     
    4746      rn2  (:,:,:) = 0.e0  
    4847      ! 
    49       CALL day_init                           ! model calendar (using both namelist and restart infos) 
    50  
    5148   END SUBROUTINE istate_init 
    5249 
  • trunk/NEMOGCM/NEMO/TOP_SRC/C14b/trcsms_c14b.F90

    r4990 r4996  
    290290      ENDIF 
    291291      !     
    292       IF( ln_diatrc ) THEN 
    293          IF( lk_iomput ) THEN 
    294             CALL iom_put( "qtrC14b"  , qtr_c14 ) 
    295             CALL iom_put( "qintC14b" , qint_c14 ) 
    296             CALL iom_put( "fdecay"   , zdecay   ) 
    297           ELSE 
     292      IF( lk_iomput ) THEN 
     293        CALL iom_put( "qtrC14b"  , qtr_c14  ) 
     294        CALL iom_put( "qintC14b" , qint_c14 ) 
     295        CALL iom_put( "fdecay"   , zdecay  ) 
     296      ELSE 
     297         IF( ln_diatrc ) THEN 
    298298            trc2d(:,:  ,jp_c14b0_2d     ) = qtr_c14 (:,:) 
    299299            trc2d(:,:  ,jp_c14b0_2d + 1 ) = qint_c14(:,:) 
    300300            trc3d(:,:,:,jp_c14b0_3d     ) = zdecay  (:,:,:) 
    301           ENDIF 
     301         ENDIF 
    302302      ENDIF 
    303303 
  • trunk/NEMOGCM/NEMO/TOP_SRC/C14b/trcwri_c14b.F90

    r4305 r4996  
    3737      DO jn = jp_c14b0, jp_c14b1 
    3838         cltra = TRIM( ctrcnm(jn) )                  ! short title for tracer 
    39          IF( lk_vvl ) THEN 
    40             CALL iom_put( cltra, trn(:,:,:,jn) * fse3t_n(:,:,:) ) 
    41          ELSE 
    42             CALL iom_put( cltra, trn(:,:,:,jn) ) 
    43          ENDIF 
     39         CALL iom_put( cltra, trn(:,:,:,jn) ) 
    4440      END DO 
    4541      ! 
  • trunk/NEMOGCM/NEMO/TOP_SRC/CFC/trcsms_cfc.F90

    r4990 r4996  
    185185            CALL iom_rstput( kt, nitrst, numrtw, 'qint_'//ctrcnm(jn), qint_cfc(:,:,jn) ) 
    186186         END DO 
    187       ENDIF 
    188       !                                               
    189       IF( ln_diatrc ) THEN 
    190         ! 
    191         IF( lk_iomput ) THEN 
    192            CALL iom_put( "qtrCFC11"  , qtr_cfc (:,:,1) ) 
    193            CALL iom_put( "qintCFC11" , qint_cfc(:,:,1) ) 
    194         ELSE 
    195            trc2d(:,:,jp_cfc0_2d    ) = qtr_cfc (:,:,1) 
    196            trc2d(:,:,jp_cfc0_2d + 1) = qint_cfc(:,:,1) 
    197         END IF 
    198         ! 
     187      ENDIF                                             
     188      ! 
     189      IF( lk_iomput ) THEN 
     190         CALL iom_put( "qtrCFC11"  , qtr_cfc (:,:,1) ) 
     191         CALL iom_put( "qintCFC11" , qint_cfc(:,:,1) ) 
     192      ELSE 
     193         IF( ln_diatrc ) THEN 
     194            trc2d(:,:,jp_cfc0_2d    ) = qtr_cfc (:,:,1) 
     195            trc2d(:,:,jp_cfc0_2d + 1) = qint_cfc(:,:,1) 
     196         END IF 
    199197      END IF 
    200   
     198      ! 
    201199      IF( l_trdtrc ) THEN 
    202200          DO jn = jp_cfc0, jp_cfc1 
  • trunk/NEMOGCM/NEMO/TOP_SRC/CFC/trcwri_cfc.F90

    r4305 r4996  
    3737      DO jn = jp_cfc0, jp_cfc1 
    3838         cltra = TRIM( ctrcnm(jn) )                  ! short title for tracer 
    39          IF( lk_vvl ) THEN 
    40             CALL iom_put( cltra, trn(:,:,:,jn) * fse3t_n(:,:,:) ) 
    41          ELSE 
    42             CALL iom_put( cltra, trn(:,:,:,jn) ) 
    43          ENDIF 
     39         CALL iom_put( cltra, trn(:,:,:,jn) ) 
    4440      END DO 
    4541      ! 
  • trunk/NEMOGCM/NEMO/TOP_SRC/MY_TRC/trcwri_my_trc.F90

    r4305 r4996  
    3737      DO jn = jp_myt0, jp_myt1 
    3838         cltra = TRIM( ctrcnm(jn) )                  ! short title for tracer 
    39          IF( lk_vvl ) THEN 
    40             CALL iom_put( cltra, trn(:,:,:,jn) * fse3t_n(:,:,:) ) 
    41          ELSE 
    42             CALL iom_put( cltra, trn(:,:,:,jn) ) 
    43          ENDIF 
     39         CALL iom_put( cltra, trn(:,:,:,jn) ) 
    4440      END DO 
    4541      ! 
  • trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/P2Z/p2zbio.F90

    r4990 r4996  
    110110      IF( nn_timing == 1 )  CALL timing_start('p2z_bio') 
    111111      ! 
    112       IF( ln_diatrc ) THEN 
     112      IF( ln_diatrc .OR. lk_iomput ) THEN 
    113113         CALL wrk_alloc( jpi, jpj,     17, zw2d ) 
    114114         CALL wrk_alloc( jpi, jpj, jpk, 3, zw3d ) 
     
    122122 
    123123      xksi(:,:) = 0.e0        ! zooplakton closure ( fbod) 
    124       IF( ln_diatrc ) THEN 
     124      IF( ln_diatrc .OR. lk_iomput ) THEN 
    125125         zw2d  (:,:,:) = 0.e0 
    126126         zw3d(:,:,:,:) = 0.e0 
     
    239239                  !  trend number 17 in p2zexp 
    240240                ENDIF 
    241                 IF( ln_diatrc ) THEN 
     241                IF( ln_diatrc .OR. lk_iomput ) THEN 
    242242                  ! convert fluxes in per day 
    243243                  ze3t = fse3t(ji,jj,jk) * 86400. 
     
    360360                  !  trend number 17 in p2zexp  
    361361                ENDIF 
    362                 IF( ln_diatrc ) THEN 
     362                IF( ln_diatrc .OR. lk_iomput ) THEN 
    363363                  ! convert fluxes in per day 
    364364                  ze3t = fse3t(ji,jj,jk) * 86400. 
     
    390390      END DO 
    391391 
    392       IF( ln_diatrc ) THEN 
    393          ! 
     392      IF( ln_diatrc .OR. lk_iomput ) THEN 
    394393         DO jl = 1, 17  
    395394            CALL lbc_lnk( zw2d(:,:,jl),'T', 1. ) 
     
    398397            CALL lbc_lnk( zw3d(:,:,:,jl),'T', 1. ) 
    399398         END DO 
    400          IF( lk_iomput ) THEN 
     399      ENDIF 
     400      IF( lk_iomput ) THEN 
    401401            ! Save diagnostics 
    402             CALL iom_put( "TNO3PHY", zw2d(:,:,1) ) 
    403             CALL iom_put( "TNH4PHY", zw2d(:,:,2) ) 
    404             CALL iom_put( "TPHYDOM", zw2d(:,:,3) ) 
    405             CALL iom_put( "TPHYNH4", zw2d(:,:,4) ) 
    406             CALL iom_put( "TPHYZOO", zw2d(:,:,5) ) 
    407             CALL iom_put( "TPHYDET", zw2d(:,:,6) ) 
    408             CALL iom_put( "TDETZOO", zw2d(:,:,7) ) 
    409             CALL iom_put( "TZOODET", zw2d(:,:,8) ) 
    410             CALL iom_put( "TZOOBOD", zw2d(:,:,9) ) 
    411             CALL iom_put( "TZOONH4", zw2d(:,:,10) ) 
    412             CALL iom_put( "TZOODOM", zw2d(:,:,11) ) 
    413             CALL iom_put( "TNH4NO3", zw2d(:,:,12) ) 
    414             CALL iom_put( "TDOMNH4", zw2d(:,:,13) ) 
    415             CALL iom_put( "TDETNH4", zw2d(:,:,14) ) 
    416             CALL iom_put( "TPHYTOT", zw2d(:,:,15) ) 
    417             CALL iom_put( "TZOOTOT", zw2d(:,:,16) ) 
    418             !  
    419             CALL iom_put( "FNO3PHY", zw3d(:,:,:,1) ) 
    420             CALL iom_put( "FNH4PHY", zw3d(:,:,:,2) ) 
    421             CALL iom_put( "FNH4NO3", zw3d(:,:,:,3) ) 
    422             ! 
    423          ELSE 
     402        CALL iom_put( "TNO3PHY", zw2d(:,:,1) ) 
     403        CALL iom_put( "TNH4PHY", zw2d(:,:,2) ) 
     404        CALL iom_put( "TPHYDOM", zw2d(:,:,3) ) 
     405        CALL iom_put( "TPHYNH4", zw2d(:,:,4) ) 
     406        CALL iom_put( "TPHYZOO", zw2d(:,:,5) ) 
     407        CALL iom_put( "TPHYDET", zw2d(:,:,6) ) 
     408        CALL iom_put( "TDETZOO", zw2d(:,:,7) ) 
     409        CALL iom_put( "TZOODET", zw2d(:,:,8) ) 
     410        CALL iom_put( "TZOOBOD", zw2d(:,:,9) ) 
     411        CALL iom_put( "TZOONH4", zw2d(:,:,10) ) 
     412        CALL iom_put( "TZOODOM", zw2d(:,:,11) ) 
     413        CALL iom_put( "TNH4NO3", zw2d(:,:,12) ) 
     414        CALL iom_put( "TDOMNH4", zw2d(:,:,13) ) 
     415        CALL iom_put( "TDETNH4", zw2d(:,:,14) ) 
     416        CALL iom_put( "TPHYTOT", zw2d(:,:,15) ) 
     417        CALL iom_put( "TZOOTOT", zw2d(:,:,16) ) 
     418         !  
     419        CALL iom_put( "FNO3PHY", zw3d(:,:,:,1) ) 
     420        CALL iom_put( "FNH4PHY", zw3d(:,:,:,2) ) 
     421        CALL iom_put( "FNH4NO3", zw3d(:,:,:,3) ) 
     422         ! 
     423       ELSE 
     424          IF( ln_diatrc ) THEN 
    424425            ! 
    425426            trc2d(:,:,jp_pcs0_2d    ) = zw2d(:,:,1)  
     
    467468      ENDIF 
    468469      ! 
    469       IF( ln_diatrc ) THEN 
     470      IF( ln_diatrc .OR. lk_iomput ) THEN 
    470471         CALL wrk_dealloc( jpi, jpj,     17, zw2d ) 
    471472         CALL wrk_dealloc( jpi, jpj, jpk, 3, zw3d ) 
  • trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/P2Z/p2zexp.F90

    r4990 r4996  
    127127  
    128128      ! Oa & Ek: diagnostics depending on jpdia2d !          left as example 
    129       IF( ln_diatrc ) THEN 
    130          IF( lk_iomput ) THEN   ;   CALL iom_put( "SEDPOC" , sedpocn ) 
    131          ELSE                   ;   trc2d(:,:,jp_pcs0_2d + 18) = sedpocn(:,:) 
    132          ENDIF 
     129      IF( lk_iomput ) THEN   
     130         CALL iom_put( "SEDPOC" , sedpocn ) 
     131      ELSE 
     132         IF( ln_diatrc )           trc2d(:,:,jp_pcs0_2d + 18) = sedpocn(:,:) 
    133133      ENDIF 
    134134 
  • trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/P2Z/p2zsed.F90

    r4990 r4996  
    108108      END DO 
    109109 
    110       IF( ln_diatrc ) THEN  
    111          CALL wrk_alloc( jpi, jpj, zw2d ) 
    112          zw2d(:,:) =  ztra(:,:,1) * fse3t(:,:,1) * 86400. 
    113          DO jk = 2, jpkm1 
    114             zw2d(:,:) = zw2d(:,:) + ztra(:,:,jk) * fse3t(:,:,jk) * 86400. 
    115          END DO 
    116          IF( lk_iomput )  THEN 
    117            CALL iom_put( "TDETSED", zw2d ) 
    118          ELSE 
    119            trc2d(:,:,jp_pcs0_2d + 7) = zw2d(:,:) 
     110      IF( lk_iomput )  THEN 
     111         IF( iom_use( "TDETSED" ) ) THEN 
     112            CALL wrk_alloc( jpi, jpj, zw2d ) 
     113            zw2d(:,:) =  ztra(:,:,1) * fse3t(:,:,1) * 86400. 
     114            DO jk = 2, jpkm1 
     115               zw2d(:,:) = zw2d(:,:) + ztra(:,:,jk) * fse3t(:,:,jk) * 86400. 
     116            END DO 
     117            CALL iom_put( "TDETSED", zw2d ) 
     118            CALL wrk_dealloc( jpi, jpj, zw2d ) 
    120119         ENDIF 
    121          CALL wrk_dealloc( jpi, jpj, zw2d ) 
     120      ELSE 
     121         IF( ln_diatrc ) THEN  
     122            CALL wrk_alloc( jpi, jpj, zw2d ) 
     123            zw2d(:,:) =  ztra(:,:,1) * fse3t(:,:,1) * 86400. 
     124            DO jk = 2, jpkm1 
     125               zw2d(:,:) = zw2d(:,:) + ztra(:,:,jk) * fse3t(:,:,jk) * 86400. 
     126            END DO 
     127            trc2d(:,:,jp_pcs0_2d + 7) = zw2d(:,:) 
     128            CALL wrk_dealloc( jpi, jpj, zw2d ) 
     129         ENDIF 
    122130      ENDIF 
    123131      ! 
  • trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zfechem.F90

    r4800 r4996  
    299299      !  Output of some diagnostics variables 
    300300      !     --------------------------------- 
    301       IF( ln_diatrc .AND. lk_iomput ) THEN 
    302          IF( jnt == nrdttrc ) THEN 
    303             CALL iom_put("Fe3"    , zFe3   (:,:,:)       * tmask(:,:,:) )   ! Fe3+ 
    304             CALL iom_put("FeL1"   , zFeL1  (:,:,:)       * tmask(:,:,:) )   ! FeL1 
    305             CALL iom_put("TL1"    , zTL1   (:,:,:)       * tmask(:,:,:) )   ! TL1 
    306             CALL iom_put("Totlig" , ztotlig(:,:,:)       * tmask(:,:,:) )   ! TL 
    307             CALL iom_put("Biron"  , biron  (:,:,:) * 1e9 * tmask(:,:,:) )   ! biron 
    308             IF( ln_fechem ) THEN 
    309                CALL iom_put("Fe2" , zFe2   (:,:,:)       * tmask(:,:,:) )   ! Fe2+ 
    310                CALL iom_put("FeL2", zFeL2  (:,:,:)       * tmask(:,:,:) )   ! FeL2 
    311                CALL iom_put("FeP" , zFeP   (:,:,:)       * tmask(:,:,:) )   ! FeP 
    312                CALL iom_put("TL2" , zTL2   (:,:,:)       * tmask(:,:,:) )   ! TL2 
    313             ENDIF 
     301      IF( lk_iomput .AND. jnt == nrdttrc ) THEN 
     302         IF( iom_use("Fe3")    )  CALL iom_put("Fe3"    , zFe3   (:,:,:)       * tmask(:,:,:) )   ! Fe3+ 
     303         IF( iom_use("FeL1")   )  CALL iom_put("FeL1"   , zFeL1  (:,:,:)       * tmask(:,:,:) )   ! FeL1 
     304         IF( iom_use("TL1")    )  CALL iom_put("TL1"    , zTL1   (:,:,:)       * tmask(:,:,:) )   ! TL1 
     305         IF( iom_use("Totlig") )  CALL iom_put("Totlig" , ztotlig(:,:,:)       * tmask(:,:,:) )   ! TL 
     306         IF( iom_use("Biron")  )  CALL iom_put("Biron"  , biron  (:,:,:) * 1e9 * tmask(:,:,:) )   ! biron 
     307         IF( ln_fechem ) THEN 
     308            IF( iom_use("Fe2")  ) CALL iom_put("Fe2"    , zFe2   (:,:,:)       * tmask(:,:,:) )   ! Fe2+ 
     309            IF( iom_use("FeL2") ) CALL iom_put("FeL2"   , zFeL2  (:,:,:)       * tmask(:,:,:) )   ! FeL2 
     310            IF( iom_use("FeP")  ) CALL iom_put("FeP"    , zFeP   (:,:,:)       * tmask(:,:,:) )   ! FeP 
     311            IF( iom_use("TL2")  ) CALL iom_put("TL2"    , zTL2   (:,:,:)       * tmask(:,:,:) )   ! TL2 
    314312         ENDIF 
    315313      ENDIF 
  • trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zflx.F90

    r4624 r4996  
    8989      REAL(wp) ::   zyr_dec, zdco2dt 
    9090      CHARACTER (len=25) :: charout 
    91       REAL(wp), POINTER, DIMENSION(:,:) :: zkgco2, zkgo2, zh2co3, zoflx  
     91      REAL(wp), POINTER, DIMENSION(:,:) :: zkgco2, zkgo2, zh2co3, zoflx, zw2d  
    9292      !!--------------------------------------------------------------------- 
    9393      ! 
     
    196196      END DO 
    197197 
    198       t_oce_co2_flx = t_oce_co2_flx + glob_sum( oce_co2(:,:) )      ! Cumulative Total Flux of Carbon 
    199       t_atm_co2_flx = glob_sum( satmco2(:,:) * e1e2t(:,:) )         ! Total atmospheric pCO2 
    200  
     198      t_oce_co2_flx     = glob_sum( oce_co2(:,:) )                    !  Total Flux of Carbon 
     199      t_oce_co2_flx_cum = t_oce_co2_flx_cum + t_oce_co2_flx       !  Cumulative Total Flux of Carbon 
     200!      t_atm_co2_flx     = glob_sum( satmco2(:,:) * e1e2t(:,:) )       ! Total atmospheric pCO2 
     201      t_atm_co2_flx     =  atcco2      ! Total atmospheric pCO2 
     202  
    201203      IF(ln_ctl)   THEN  ! print mean trends (used for debugging) 
    202204         WRITE(charout, FMT="('flx ')") 
     
    205207      ENDIF 
    206208 
    207       IF( ln_diatrc ) THEN 
    208          IF( lk_iomput ) THEN 
    209             CALL iom_put( "Cflx" , oce_co2(:,:) / e1e2t(:,:) / rfact )  
    210             CALL iom_put( "Oflx" , zoflx(:,:) * 1000 * tmask(:,:,1)  ) 
    211             CALL iom_put( "Kg"   , zkgco2(:,:) * tmask(:,:,1) ) 
    212             CALL iom_put( "Dpco2", ( satmco2(:,:) * patm(:,:) - zh2co3(:,:) / ( chemc(:,:,1) + rtrn ) ) * tmask(:,:,1) ) 
    213             CALL iom_put( "Dpo2" , ( atcox * patm(:,:) - trn(:,:,1,jpoxy) / ( chemc(:,:,2) + rtrn ) ) * tmask(:,:,1) ) 
    214          ELSE 
     209      IF( lk_iomput ) THEN 
     210         CALL wrk_alloc( jpi, jpj, zw2d )   
     211         IF( iom_use( "Cflx"  ) )  THEN 
     212            zw2d(:,:) = oce_co2(:,:) / e1e2t(:,:) / rfact 
     213            CALL iom_put( "Cflx"     , zw2d )  
     214         ENDIF 
     215         IF( iom_use( "Oflx"  ) )  THEN 
     216            zw2d(:,:) =  zoflx(:,:) * 1000 * tmask(:,:,1) 
     217            CALL iom_put( "Oflx" , zw2d ) 
     218         ENDIF 
     219         IF( iom_use( "Kg"    ) )  THEN 
     220            zw2d(:,:) =  zkgco2(:,:) * tmask(:,:,1) 
     221            CALL iom_put( "Kg"   , zw2d ) 
     222         ENDIF 
     223         IF( iom_use( "Dpco2" ) ) THEN 
     224           zw2d(:,:) = ( satmco2(:,:) * patm(:,:) - zh2co3(:,:) / ( chemc(:,:,1) + rtrn ) ) * tmask(:,:,1) 
     225           CALL iom_put( "Dpco2" ,  zw2d ) 
     226         ENDIF 
     227         IF( iom_use( "Dpo2" ) )  THEN 
     228           zw2d(:,:) = ( atcox * patm(:,:) - trn(:,:,1,jpoxy) / ( chemc(:,:,2) + rtrn ) ) * tmask(:,:,1) 
     229           CALL iom_put( "Dpo2"  , zw2d ) 
     230         ENDIF 
     231         IF( iom_use( "tcflx" ) )  CALL iom_put( "tcflx"    , t_oce_co2_flx * rfact2r )   ! molC/s 
     232         CALL iom_put( "tcflxcum" , t_oce_co2_flx_cum )      ! molC 
     233         ! 
     234         CALL wrk_dealloc( jpi, jpj, zw2d ) 
     235      ELSE 
     236         IF( ln_diatrc ) THEN 
    215237            trc2d(:,:,jp_pcs0_2d    ) = oce_co2(:,:) / e1e2t(:,:) / rfact  
    216238            trc2d(:,:,jp_pcs0_2d + 1) = zoflx(:,:) * 1000 * tmask(:,:,1)  
     
    290312      ! 
    291313      oce_co2(:,:)  = 0._wp                ! Initialization of Flux of Carbon 
     314      t_oce_co2_flx = 0._wp 
    292315      t_atm_co2_flx = 0._wp 
    293       t_oce_co2_flx = 0._wp 
    294316      ! 
    295317      CALL p4z_patm( nit000 ) 
  • trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zlim.F90

    r4624 r4996  
    187187      END DO 
    188188      ! 
    189       IF( ln_diatrc .AND. lk_iomput .AND. jnt == nrdttrc ) THEN        ! save output diagnostics 
    190         ! 
    191         CALL iom_put( "xfracal", xfracal(:,:,:) * tmask(:,:,:) )  ! euphotic layer deptht 
    192         CALL iom_put( "LNnut"  , xlimphy(:,:,:) * tmask(:,:,:) )  ! Nutrient limitation term 
    193         CALL iom_put( "LDnut"  , xlimdia(:,:,:) * tmask(:,:,:) )  ! Nutrient limitation term 
    194         CALL iom_put( "LNFe"   , xlimnfe(:,:,:) * tmask(:,:,:) )  ! Iron limitation term 
    195         CALL iom_put( "LDFe"   , xlimdfe(:,:,:) * tmask(:,:,:) )  ! Iron limitation term 
    196         ! 
     189      ! 
     190      IF( lk_iomput .AND. jnt == nrdttrc ) THEN        ! save output diagnostics 
     191        IF( iom_use( "xfracal" ) ) CALL iom_put( "xfracal", xfracal(:,:,:) * tmask(:,:,:) )  ! euphotic layer deptht 
     192        IF( iom_use( "LNnut"   ) ) CALL iom_put( "LNnut"  , xlimphy(:,:,:) * tmask(:,:,:) )  ! Nutrient limitation term 
     193        IF( iom_use( "LDnut"   ) ) CALL iom_put( "LDnut"  , xlimdia(:,:,:) * tmask(:,:,:) )  ! Nutrient limitation term 
     194        IF( iom_use( "LNFe"    ) ) CALL iom_put( "LNFe"   , xlimnfe(:,:,:) * tmask(:,:,:) )  ! Iron limitation term 
     195        IF( iom_use( "LDFe"    ) ) CALL iom_put( "LDFe"   , xlimdfe(:,:,:) * tmask(:,:,:) )  ! Iron limitation term 
    197196      ENDIF 
    198  
    199197      ! 
    200198      IF( nn_timing == 1 )  CALL timing_stop('p4z_lim') 
  • trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zlys.F90

    r4624 r4996  
    146146      END DO 
    147147      ! 
    148       IF( ln_diatrc )  THEN 
    149          ! 
    150          IF( lk_iomput ) THEN 
    151             zrfact2 = 1.e3 * rfact2r 
    152             CALL iom_put( "PH"    , -1. * LOG10( hi(:,:,:) )                * tmask(:,:,:) ) 
    153             CALL iom_put( "CO3"   ,        zco3    (:,:,:) * 1e+3           * tmask(:,:,:) ) 
    154             CALL iom_put( "CO3sat",        aksp    (:,:,:) * 1e+3 / calcon  * tmask(:,:,:) ) 
    155             CALL iom_put( "DCAL"  ,        zcaldiss(:,:,:) * zrfact2        * tmask(:,:,:) ) 
    156          ELSE 
    157             trc3d(:,:,:,jp_pcs0_3d    ) = -1. * LOG10( hi(:,:,:) ) * tmask(:,:,:) 
    158             trc3d(:,:,:,jp_pcs0_3d + 1) = zco3(:,:,:)              * tmask(:,:,:) 
    159             trc3d(:,:,:,jp_pcs0_3d + 2) = aksp(:,:,:) / calcon     * tmask(:,:,:) 
    160          ENDIF 
    161          ! 
     148 
     149      IF( lk_iomput ) THEN 
     150         IF( iom_use( "PH"     ) ) CALL iom_put( "PH"    , -1. * LOG10( hi(:,:,:) )          * tmask(:,:,:) ) 
     151         IF( iom_use( "CO3"    ) ) CALL iom_put( "CO3"   , zco3(:,:,:) * 1.e+3               * tmask(:,:,:) ) 
     152         IF( iom_use( "CO3sat" ) ) CALL iom_put( "CO3sat", aksp(:,:,:) * 1.e+3 / calcon      * tmask(:,:,:) ) 
     153         IF( iom_use( "DCAL"   ) ) CALL iom_put( "DCAL"  , zcaldiss(:,:,:) * 1.e+3 * rfact2r * tmask(:,:,:) ) 
     154      ELSE 
     155         trc3d(:,:,:,jp_pcs0_3d    ) = -1. * LOG10( hi(:,:,:) ) * tmask(:,:,:) 
     156         trc3d(:,:,:,jp_pcs0_3d + 1) = zco3(:,:,:)              * tmask(:,:,:) 
     157         trc3d(:,:,:,jp_pcs0_3d + 2) = aksp(:,:,:) / calcon     * tmask(:,:,:) 
    162158      ENDIF 
    163159      ! 
  • trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zmeso.F90

    r4800 r4996  
    8383      REAL(wp) :: zgrazfffp, zgrazfffg, zgrazffep, zgrazffeg 
    8484      CHARACTER (len=25) :: charout 
    85       REAL(wp) :: zrfact2 
    86       REAL(wp), POINTER, DIMENSION(:,:,:) :: zgrazing 
     85      REAL(wp), POINTER, DIMENSION(:,:,:) :: zgrazing, zw3d 
    8786 
    8887      !!--------------------------------------------------------------------- 
     
    9089      IF( nn_timing == 1 )  CALL timing_start('p4z_meso') 
    9190      ! 
    92       IF( ln_diatrc .AND. lk_iomput ) THEN 
     91      IF( lk_iomput ) THEN 
    9392         CALL wrk_alloc( jpi, jpj, jpk, zgrazing ) 
    9493         zgrazing(:,:,:) = 0._wp 
     
    186185 
    187186              ! Total grazing ( grazing by microzoo is already computed in p4zmicro ) 
    188               IF( ln_diatrc .AND. lk_iomput )  zgrazing(ji,jj,jk) = zgraztot 
     187              IF( lk_iomput )  zgrazing(ji,jj,jk) = zgraztot 
    189188 
    190189              !    Mesozooplankton efficiency 
     
    249248      END DO 
    250249      ! 
    251       IF( ln_diatrc .AND. lk_iomput .AND. jnt == nrdttrc ) THEN 
    252          zrfact2 = 1.e3 * rfact2r 
    253          CALL iom_put( "GRAZ2", zgrazing(:,:,:) * zrfact2 * tmask(:,:,:) )  ! Total grazing of phyto by zooplankton 
    254          CALL iom_put( "PCAL" , prodcal(:,:,:)  * zrfact2 * tmask(:,:,:) )  ! Calcite production 
     250      IF( lk_iomput .AND. jnt == nrdttrc ) THEN 
     251         CALL wrk_alloc( jpi, jpj, jpk, zw3d ) 
     252         IF( iom_use( "GRAZ2" ) ) THEN 
     253            zw3d(:,:,:) = zgrazing(:,:,:) * 1.e+3 * rfact2r * tmask(:,:,:)  !   Total grazing of phyto by zooplankton 
     254            CALL iom_put( "GRAZ2", zw3d ) 
     255         ENDIF 
     256         IF( iom_use( "PCAL" ) ) THEN 
     257            zw3d(:,:,:) = prodcal(:,:,:) * 1.e+3 * rfact2r * tmask(:,:,:)   !  Calcite production 
     258            CALL iom_put( "PCAL", zw3d )   
     259         ENDIF 
     260         CALL wrk_dealloc( jpi, jpj, jpk, zw3d ) 
    255261      ENDIF 
    256262      ! 
     
    261267      ENDIF 
    262268      ! 
    263       IF( ln_diatrc .AND. lk_iomput )  CALL wrk_dealloc( jpi, jpj, jpk, zgrazing ) 
     269      IF( lk_iomput )  CALL wrk_dealloc( jpi, jpj, jpk, zgrazing ) 
    264270      ! 
    265271      IF( nn_timing == 1 )  CALL timing_stop('p4z_meso') 
  • trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zmicro.F90

    r4800 r4996  
    7979      REAL(wp) :: zgrazp, zgrazm, zgrazsd 
    8080      REAL(wp) :: zgrazmf, zgrazsf, zgrazpf 
    81       REAL(wp) :: zrfact2 
    82       REAL(wp), POINTER, DIMENSION(:,:,:) :: zgrazing 
     81      REAL(wp), POINTER, DIMENSION(:,:,:) :: zgrazing, zw3d 
    8382      CHARACTER (len=25) :: charout 
    8483      !!--------------------------------------------------------------------- 
     
    8685      IF( nn_timing == 1 )  CALL timing_start('p4z_micro') 
    8786      ! 
    88       IF( ln_diatrc .AND. lk_iomput )  CALL wrk_alloc( jpi, jpj, jpk, zgrazing ) 
     87      IF( lk_iomput )  CALL wrk_alloc( jpi, jpj, jpk, zgrazing ) 
    8988      ! 
    9089      DO jk = 1, jpkm1 
     
    191190      END DO 
    192191      ! 
    193       IF( ln_diatrc .AND. lk_iomput .AND. jnt == nrdttrc ) THEN 
    194          zrfact2 = 1.e3 * rfact2r 
    195          CALL iom_put( "GRAZ1" , zgrazing(:,:,:) * zrfact2 * tmask(:,:,:) )  ! Total grazing of phyto by zooplankton 
     192      IF( lk_iomput .AND. jnt == nrdttrc ) THEN 
     193         CALL wrk_alloc( jpi, jpj, jpk, zw3d ) 
     194         IF( iom_use( "GRAZ1" ) ) THEN 
     195            zw3d(:,:,:) = zgrazing(:,:,:) * 1.e+3 * rfact2r * tmask(:,:,:)  !  Total grazing of phyto by zooplankton 
     196            CALL iom_put( "GRAZ1", zw3d ) 
     197         ENDIF 
     198         CALL wrk_dealloc( jpi, jpj, jpk, zw3d ) 
    196199      ENDIF 
    197200      ! 
     
    202205      ENDIF 
    203206      ! 
    204       IF( ln_diatrc .AND. lk_iomput )  CALL wrk_dealloc( jpi, jpj, jpk, zgrazing ) 
     207      IF( lk_iomput )  CALL wrk_dealloc( jpi, jpj, jpk, zgrazing ) 
    205208      ! 
    206209      IF( nn_timing == 1 )  CALL timing_stop('p4z_micro') 
  • trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zopt.F90

    r4990 r4996  
    252252      END DO 
    253253 
    254       IF( ln_diatrc ) THEN        ! save output diagnostics 
    255         ! 
    256         IF( lk_iomput ) THEN 
    257            IF( jnt == nrdttrc ) THEN 
    258               CALL iom_put( "Heup", heup(:,:  ) * tmask(:,:,1) )  ! euphotic layer deptht 
    259               CALL iom_put( "PAR" , emoy(:,:,:) * tmask(:,:,:) )  ! Photosynthetically Available Radiation 
    260            ENDIF 
    261         ELSE 
    262            trc2d(:,:,  jp_pcs0_2d + 10) = heup(:,:  ) * tmask(:,:,1)   
    263            trc3d(:,:,:,jp_pcs0_3d + 3)  = etot(:,:,:) * tmask(:,:,:) 
     254      IF( lk_iomput ) THEN 
     255        IF( jnt == nrdttrc  ) THEN 
     256           IF( iom_use( "Heup" ) ) CALL iom_put( "Heup", heup(:,:  ) * tmask(:,:,1) )  ! euphotic layer deptht 
     257           IF( iom_use( "PAR"  ) ) CALL iom_put( "PAR" , emoy(:,:,:) * tmask(:,:,:) )  ! Photosynthetically Available Radiation 
    264258        ENDIF 
    265         ! 
     259      ELSE 
     260         IF( ln_diatrc ) THEN        ! save output diagnostics 
     261            trc2d(:,:,  jp_pcs0_2d + 10) = heup(:,:  ) * tmask(:,:,1)   
     262            trc3d(:,:,:,jp_pcs0_3d + 3)  = etot(:,:,:) * tmask(:,:,:) 
     263         ENDIF 
    266264      ENDIF 
    267265      ! 
  • trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zprod.F90

    r4624 r4996  
    8383      REAL(wp) ::   zpislopen  , zpislope2n 
    8484      REAL(wp) ::   zrum, zcodel, zargu, zval 
    85       REAL(wp) ::   zrfact2 
     85      REAL(wp) ::   zfact 
    8686      CHARACTER (len=25) :: charout 
    87       REAL(wp), POINTER, DIMENSION(:,:  ) :: zmixnano, zmixdiat, zstrn 
    88       REAL(wp), POINTER, DIMENSION(:,:,:) :: zpislopead, zpislopead2, zprdia, zprbio, zprdch, zprnch, zysopt    
     87      REAL(wp), POINTER, DIMENSION(:,:  ) :: zmixnano, zmixdiat, zstrn, zw2d 
     88      REAL(wp), POINTER, DIMENSION(:,:,:) :: zpislopead, zpislopead2, zprdia, zprbio, zprdch, zprnch, zysopt, zw3d    
    8989      REAL(wp), POINTER, DIMENSION(:,:,:) :: zprorca, zprorcad, zprofed, zprofen, zprochln, zprochld, zpronew, zpronewd 
    9090      !!--------------------------------------------------------------------- 
     
    412412     END DO 
    413413 
    414      ! Total primary production per year 
    415      tpp = tpp + glob_sum( ( zprorca(:,:,:) + zprorcad(:,:,:) ) * cvol(:,:,:) ) 
    416  
    417      IF( ln_diatrc ) THEN 
    418          ! 
    419          zrfact2 = 1.e3 * rfact2r  ! conversion from mol/L/timestep into mol/m3/s 
    420          IF( lk_iomput ) THEN 
    421            IF( jnt == nrdttrc ) THEN 
    422               CALL iom_put( "PPPHY"  , zprorca (:,:,:) * zrfact2 * tmask(:,:,:) )  ! primary production by nanophyto 
    423               CALL iom_put( "PPPHY2" , zprorcad(:,:,:) * zrfact2 * tmask(:,:,:) )  ! primary production by diatom 
    424               CALL iom_put( "PPNEWN" , zpronew (:,:,:) * zrfact2 * tmask(:,:,:) )  ! new primary production by nanophyto 
    425               CALL iom_put( "PPNEWD" , zpronewd(:,:,:) * zrfact2 * tmask(:,:,:) )  ! new primary production by diatom 
    426               CALL iom_put( "PBSi"   , zprorcad(:,:,:) * zrfact2 * tmask(:,:,:) * zysopt(:,:,:) ) ! biogenic silica production 
    427               CALL iom_put( "PFeD"   , zprofed (:,:,:) * zrfact2 * tmask(:,:,:) )  ! biogenic iron production by diatom 
    428               CALL iom_put( "PFeN"   , zprofen (:,:,:) * zrfact2 * tmask(:,:,:) )  ! biogenic iron production by nanophyto 
    429               CALL iom_put( "Mumax"  , prmax(:,:,:) * tmask(:,:,:) )  ! Maximum growth rate 
    430               CALL iom_put( "MuN"    , zprbio(:,:,:) * xlimphy(:,:,:) * tmask(:,:,:) )  ! Realized growth rate for nanophyto 
    431               CALL iom_put( "MuD"    , zprdia(:,:,:) * xlimdia(:,:,:) * tmask(:,:,:) )  ! Realized growth rate for diatoms 
    432               CALL iom_put( "LNlight", zprbio (:,:,:) / (prmax(:,:,:) + rtrn) * tmask(:,:,:) )  ! light limitation term 
    433               CALL iom_put( "LDlight", zprdia (:,:,:) / (prmax(:,:,:) + rtrn) * tmask(:,:,:) )  ! light limitation term 
    434            ENDIF 
    435          ELSE 
    436               trc3d(:,:,:,jp_pcs0_3d + 4)  = zprorca (:,:,:) * zrfact2 * tmask(:,:,:) 
    437               trc3d(:,:,:,jp_pcs0_3d + 5)  = zprorcad(:,:,:) * zrfact2 * tmask(:,:,:) 
    438               trc3d(:,:,:,jp_pcs0_3d + 6)  = zpronew (:,:,:) * zrfact2 * tmask(:,:,:) 
    439               trc3d(:,:,:,jp_pcs0_3d + 7)  = zpronewd(:,:,:) * zrfact2 * tmask(:,:,:) 
    440               trc3d(:,:,:,jp_pcs0_3d + 8)  = zprorcad(:,:,:) * zrfact2 * tmask(:,:,:) * zysopt(:,:,:) 
    441               trc3d(:,:,:,jp_pcs0_3d + 9)  = zprofed (:,:,:) * zrfact2 * tmask(:,:,:) 
     414 
     415    ! Total primary production per year 
     416    IF( iom_use( "tintpp" ) .OR. ( ln_check_mass .AND. kt == nitend .AND. jnt == nrdttrc )  )  & 
     417         & tpp = glob_sum( ( zprorca(:,:,:) + zprorcad(:,:,:) ) * cvol(:,:,:) ) 
     418 
     419    IF( lk_iomput ) THEN 
     420       IF( jnt == nrdttrc ) THEN 
     421          CALL wrk_alloc( jpi, jpj,      zw2d ) 
     422          CALL wrk_alloc( jpi, jpj, jpk, zw3d ) 
     423          zfact = 1.e+3 * rfact2r  !  conversion from mol/l/kt to  mol/m3/s 
     424          ! 
     425          IF( iom_use( "PPPHY" ) .OR. iom_use( "PPPHY2" ) )  THEN 
     426              zw3d(:,:,:) = zprorca (:,:,:) * zfact * tmask(:,:,:)  ! primary production by nanophyto 
     427              CALL iom_put( "PPPHY"  , zw3d ) 
     428              ! 
     429              zw3d(:,:,:) = zprorcad(:,:,:) * zfact * tmask(:,:,:)  ! primary production by diatomes 
     430              CALL iom_put( "PPPHY2"  , zw3d ) 
     431          ENDIF 
     432          IF( iom_use( "PPNEWN" ) .OR. iom_use( "PPNEWD" ) )  THEN 
     433              zw3d(:,:,:) = zpronew (:,:,:) * zfact * tmask(:,:,:)  ! new primary production by nanophyto 
     434              CALL iom_put( "PPNEWN"  , zw3d ) 
     435              ! 
     436              zw3d(:,:,:) = zpronewd(:,:,:) * zfact * tmask(:,:,:)  ! new primary production by diatomes 
     437              CALL iom_put( "PPNEWD"  , zw3d ) 
     438          ENDIF 
     439          IF( iom_use( "PBSi" ) )  THEN 
     440              zw3d(:,:,:) = zprorcad(:,:,:) * zfact * tmask(:,:,:) * zysopt(:,:,:) ! biogenic silica production 
     441              CALL iom_put( "PBSi"  , zw3d ) 
     442          ENDIF 
     443          IF( iom_use( "PFeN" ) .OR. iom_use( "PFeD" ) )  THEN 
     444              zw3d(:,:,:) = zprofen(:,:,:) * zfact * tmask(:,:,:)  ! biogenic iron production by nanophyto 
     445              CALL iom_put( "PFeN"  , zw3d ) 
     446              ! 
     447              zw3d(:,:,:) = zprofed(:,:,:) * zfact * tmask(:,:,:)  ! biogenic iron production by  diatomes 
     448              CALL iom_put( "PFeD"  , zw3d ) 
     449          ENDIF 
     450          IF( iom_use( "Mumax" ) )  THEN 
     451              zw3d(:,:,:) = prmax(:,:,:) * tmask(:,:,:)   ! Maximum growth rate 
     452              CALL iom_put( "Mumax"  , zw3d ) 
     453          ENDIF 
     454          IF( iom_use( "MuN" ) .OR. iom_use( "MuD" ) )  THEN 
     455              zw3d(:,:,:) = zprbio(:,:,:) * xlimphy(:,:,:) * tmask(:,:,:)  ! Realized growth rate for nanophyto 
     456              CALL iom_put( "MuN"  , zw3d ) 
     457              ! 
     458              zw3d(:,:,:) =  zprdia(:,:,:) * xlimdia(:,:,:) * tmask(:,:,:)  ! Realized growth rate for diatoms 
     459              CALL iom_put( "MuD"  , zw3d ) 
     460          ENDIF 
     461          IF( iom_use( "LNlight" ) .OR. iom_use( "LDlight" ) )  THEN 
     462              zw3d(:,:,:) = zprbio (:,:,:) / (prmax(:,:,:) + rtrn) * tmask(:,:,:) ! light limitation term 
     463              CALL iom_put( "LNlight"  , zw3d ) 
     464              ! 
     465              zw3d(:,:,:) =  zprdia (:,:,:) / (prmax(:,:,:) + rtrn) * tmask(:,:,:)  ! light limitation term 
     466              CALL iom_put( "LDlight"  , zw3d ) 
     467          ENDIF 
     468          IF( iom_use( "TPP" ) )  THEN 
     469              zw3d(:,:,:) = ( zprorca(:,:,:) + zprorcad(:,:,:) ) * zfact * tmask(:,:,:)  ! total primary production 
     470              CALL iom_put( "TPP"  , zw3d ) 
     471          ENDIF 
     472          IF( iom_use( "TPNEW" ) )  THEN 
     473              zw3d(:,:,:) = ( zpronew(:,:,:) + zpronewd(:,:,:) ) * zfact * tmask(:,:,:)  ! total new production 
     474              CALL iom_put( "TPNEW"  , zw3d ) 
     475          ENDIF 
     476          IF( iom_use( "TPBFE" ) )  THEN 
     477              zw3d(:,:,:) = ( zprofen(:,:,:) + zprofed(:,:,:) ) * zfact * tmask(:,:,:)  ! total biogenic iron production 
     478              CALL iom_put( "TPBFE"  , zw3d ) 
     479          ENDIF 
     480          IF( iom_use( "INTPPPHY" ) .OR. iom_use( "INTPPPHY2" ) ) THEN   
     481             zw2d(:,:) = 0. 
     482             DO jk = 1, jpkm1 
     483               zw2d(:,:) = zw2d(:,:) + zprorca (:,:,jk) * fse3t(:,:,jk) * zfact * tmask(:,:,jk)  ! vert. integrated  primary produc. by nano 
     484             ENDDO 
     485             CALL iom_put( "INTPPPHY" , zw2d ) 
     486             ! 
     487             zw2d(:,:) = 0. 
     488             DO jk = 1, jpkm1 
     489                zw2d(:,:) = zw2d(:,:) + zprorcad(:,:,jk) * fse3t(:,:,jk) * zfact * tmask(:,:,jk) ! vert. integrated  primary produc. by diatom 
     490             ENDDO 
     491             CALL iom_put( "INTPPPHY2" , zw2d ) 
     492          ENDIF 
     493          IF( iom_use( "INTPP" ) ) THEN    
     494             zw2d(:,:) = 0. 
     495             DO jk = 1, jpkm1 
     496                zw2d(:,:) = zw2d(:,:) + ( zprorca(:,:,jk) + zprorcad(:,:,jk) ) * fse3t(:,:,jk) * zfact * tmask(:,:,jk) ! vert. integrated pp 
     497             ENDDO 
     498             CALL iom_put( "INTPP" , zw2d ) 
     499          ENDIF 
     500          IF( iom_use( "INTPNEW" ) ) THEN     
     501             zw2d(:,:) = 0. 
     502             DO jk = 1, jpkm1 
     503                zw2d(:,:) = zw2d(:,:) + ( zpronew(:,:,jk) + zpronewd(:,:,jk) ) * fse3t(:,:,jk) * zfact * tmask(:,:,jk)  ! vert. integrated new prod 
     504             ENDDO 
     505             CALL iom_put( "INTPNEW" , zw2d ) 
     506          ENDIF 
     507          IF( iom_use( "INTPBFE" ) ) THEN           !   total biogenic iron production  ( vertically integrated ) 
     508             zw2d(:,:) = 0. 
     509             DO jk = 1, jpkm1 
     510                zw2d(:,:) = zw2d(:,:) + ( zprofen(:,:,jk) + zprofed(:,:,jk) ) * fse3t(:,:,jk) * zfact * tmask(:,:,jk) ! vert integr. bfe prod 
     511             ENDDO 
     512            CALL iom_put( "INTPBFE" , zw2d ) 
     513          ENDIF 
     514          IF( iom_use( "INTPBSI" ) ) THEN           !   total biogenic silica production  ( vertically integrated ) 
     515             zw2d(:,:) = 0. 
     516             DO jk = 1, jpkm1 
     517                zw2d(:,:) = zw2d(:,:) + zprorcad(:,:,jk) * zysopt(:,:,jk) * fse3t(:,:,jk) * zfact * tmask(:,:,jk)  ! vert integr. bsi prod 
     518             ENDDO 
     519             CALL iom_put( "INTPBSI" , zw2d ) 
     520          ENDIF 
     521          IF( iom_use( "tintpp" ) )  CALL iom_put( "tintpp" , tpp * zfact )  !  global total integrated primary production molC/s 
     522          ! 
     523          CALL wrk_dealloc( jpi, jpj,      zw2d ) 
     524          CALL wrk_dealloc( jpi, jpj, jpk, zw3d ) 
     525       ENDIF 
     526     ELSE 
     527        IF( ln_diatrc ) THEN 
     528           zfact = 1.e+3 * rfact2r 
     529           trc3d(:,:,:,jp_pcs0_3d + 4)  = zprorca (:,:,:) * zfact * tmask(:,:,:) 
     530           trc3d(:,:,:,jp_pcs0_3d + 5)  = zprorcad(:,:,:) * zfact * tmask(:,:,:) 
     531           trc3d(:,:,:,jp_pcs0_3d + 6)  = zpronew (:,:,:) * zfact * tmask(:,:,:) 
     532           trc3d(:,:,:,jp_pcs0_3d + 7)  = zpronewd(:,:,:) * zfact * tmask(:,:,:) 
     533           trc3d(:,:,:,jp_pcs0_3d + 8)  = zprorcad(:,:,:) * zfact * tmask(:,:,:) * zysopt(:,:,:) 
     534           trc3d(:,:,:,jp_pcs0_3d + 9)  = zprofed (:,:,:) * zfact * tmask(:,:,:) 
    442535#  if ! defined key_kriest 
    443               trc3d(:,:,:,jp_pcs0_3d + 10) = zprofen (:,:,:) * zrfact2 * tmask(:,:,:) 
     536           trc3d(:,:,:,jp_pcs0_3d + 10) = zprofen (:,:,:) * zfact * tmask(:,:,:) 
    444537#  endif 
    445          ENDIF 
    446          ! 
    447       ENDIF 
    448  
    449       IF(ln_ctl)   THEN  ! print mean trends (used for debugging) 
     538        ENDIF 
     539     ENDIF 
     540 
     541     IF(ln_ctl)   THEN  ! print mean trends (used for debugging) 
    450542         WRITE(charout, FMT="('prod')") 
    451543         CALL prt_ctl_trc_info(charout) 
    452544         CALL prt_ctl_trc(tab4d=tra, mask=tmask, clinfo=ctrcnm) 
    453       ENDIF 
    454       ! 
    455       CALL wrk_dealloc( jpi, jpj,      zmixnano, zmixdiat, zstrn                                                  ) 
    456       CALL wrk_dealloc( jpi, jpj, jpk, zpislopead, zpislopead2, zprdia, zprbio, zprdch, zprnch, zysopt            )  
    457       CALL wrk_dealloc( jpi, jpj, jpk, zprorca, zprorcad, zprofed, zprofen, zprochln, zprochld, zpronew, zpronewd ) 
    458       ! 
    459       IF( nn_timing == 1 )  CALL timing_stop('p4z_prod') 
    460       ! 
     545     ENDIF 
     546     ! 
     547     CALL wrk_dealloc( jpi, jpj,      zmixnano, zmixdiat, zstrn                                                  ) 
     548     CALL wrk_dealloc( jpi, jpj, jpk, zpislopead, zpislopead2, zprdia, zprbio, zprdch, zprnch, zysopt            )  
     549     CALL wrk_dealloc( jpi, jpj, jpk, zprorca, zprorcad, zprofed, zprofen, zprochln, zprochld, zpronew, zpronewd ) 
     550     ! 
     551     IF( nn_timing == 1 )  CALL timing_stop('p4z_prod') 
     552     ! 
    461553   END SUBROUTINE p4z_prod 
    462554 
  • trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zrem.F90

    r4624 r4996  
    7878      REAL(wp) ::   zofer2 
    7979#endif 
    80       REAL(wp) ::   zonitr, zstep, zrfact2 
     80      REAL(wp) ::   zonitr, zstep, zfact 
    8181      CHARACTER (len=25) :: charout 
    82       REAL(wp), POINTER, DIMENSION(:,:  ) :: ztempbac  
    83       REAL(wp), POINTER, DIMENSION(:,:,:) :: zdepbac, zolimi, zdepprod 
     82      REAL(wp), POINTER, DIMENSION(:,:  ) :: ztempbac 
     83      REAL(wp), POINTER, DIMENSION(:,:,:) :: zdepbac, zolimi, zdepprod, zw3d 
    8484      !!--------------------------------------------------------------------- 
    8585      ! 
     
    315315      END DO 
    316316 
    317       IF( ln_diatrc .AND. lk_iomput .AND. jnt == nrdttrc ) THEN 
    318           zrfact2 = 1.e3 * rfact2r 
    319           CALL iom_put( "REMIN" , zolimi(:,:,:) * tmask(:,:,:) * zrfact2 )  ! Remineralisation rate 
    320           CALL iom_put( "DENIT" , denitr(:,:,:) * rdenit * rno3 * tmask(:,:,:) * zrfact2  )  ! Denitrification 
    321       ENDIF 
     317      IF( jnt == nrdttrc ) THEN 
     318          CALL wrk_alloc( jpi, jpj, jpk, zw3d ) 
     319          zfact = 1.e+3 * rfact2r  !  conversion from mol/l/kt to  mol/m3/s 
     320          ! 
     321          IF( iom_use( "REMIN" ) )  THEN 
     322              zw3d(:,:,:) = zolimi(:,:,:) * tmask(:,:,:) * zfact !  Remineralisation rate 
     323              CALL iom_put( "REMIN"  , zw3d ) 
     324          ENDIF 
     325          IF( iom_use( "DENIT" ) )  THEN 
     326              zw3d(:,:,:) = denitr(:,:,:) * rdenit * rno3 * tmask(:,:,:) * zfact ! Denitrification 
     327              CALL iom_put( "DENIT"  , zw3d ) 
     328          ENDIF 
     329          ! 
     330          CALL wrk_dealloc( jpi, jpj, jpk, zw3d ) 
     331       ENDIF 
    322332 
    323333      IF(ln_ctl)   THEN  ! print mean trends (used for debugging) 
  • trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsbc.F90

    r4624 r4996  
    8080   REAL(wp), PUBLIC :: rivdininput, rivdipinput, rivdsiinput 
    8181 
    82    REAL(wp) :: ryyss                    !: number of seconds per year  
    8382 
    8483   !!* Substitution 
     
    207206      ! 
    208207      IF( nn_timing == 1 )  CALL timing_start('p4z_sbc_init') 
    209       ! 
    210       ryyss   = nyear_len(1) * rday    ! number of seconds per year and per month 
    211208      ! 
    212209      !                            !* set file information 
  • trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsed.F90

    r4800 r4996  
    3333 
    3434   !! * Module variables 
    35    REAL(wp) :: ryyss                    !: number of seconds per year  
    36    REAL(wp) :: r1_ryyss                 !: inverse of ryyss 
    3735   REAL(wp) :: r1_rday                  !: inverse of rday 
    3836 
     
    8381      ! 
    8482      IF( kt == nittrc000 .AND. jnt == 1 )  THEN 
    85          ryyss    = nyear_len(1) * rday    ! number of seconds per year and per month 
    8683         r1_rday  = 1. / rday 
    87          r1_ryyss = 1. / ryyss 
    8884         IF( ln_check_mass .AND. lwp)  & 
    8985           &  CALL ctl_opn( numnit, 'nitrogen.budget', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, 6, .FALSE., narea ) 
     
    119115         ! 
    120116         trn(:,:,1,jpfer) = trn(:,:,1,jpfer) + zironice(:,:)  
    121          !                                               
    122          IF( ln_diatrc .AND. lk_iomput .AND. jnt == nrdttrc )   & 
     117         !  
     118         IF( lk_iomput .AND. jnt == nrdttrc .AND. iom_use( "Ironice" ) )   & 
    123119            &   CALL iom_put( "Ironice", zironice(:,:) * 1.e+3 * rfact2r * fse3t(:,:,1) * tmask(:,:,1) ) ! iron flux from ice 
     120         ! 
    124121         CALL wrk_dealloc( jpi, jpj, zironice ) 
    125122         !                                               
     
    150147         trn(:,:,1,jpsil) = trn(:,:,1,jpsil) + zsidep  (:,:) 
    151148         trn(:,:,:,jpfer) = trn(:,:,:,jpfer) + zirondep(:,:,:)  
    152          !                                               
    153          IF( ln_diatrc ) THEN 
    154             zfact = 1.e+3 * rfact2r 
    155             IF( lk_iomput ) THEN 
    156                IF( jnt == nrdttrc ) THEN 
    157                   CALL iom_put( "Irondep", zirondep(:,:,1) * zfact * fse3t(:,:,1) * tmask(:,:,1) ) ! surface downward dust depo of iron 
    158                   CALL iom_put( "pdust"  , dust(:,:) / ( wdust * rday )  * tmask(:,:,1) ) ! dust concentration at surface 
    159                ENDIF 
    160             ELSE 
    161                trc2d(:,:,jp_pcs0_2d + 11) = zirondep(:,:,1) * zfact * fse3t(:,:,1) * tmask(:,:,1) 
     149         !  
     150         IF( lk_iomput ) THEN 
     151            IF( jnt == nrdttrc ) THEN 
     152                IF( iom_use( "Irondep" ) )   & 
     153                &  CALL iom_put( "Irondep", zirondep(:,:,1) * 1.e+3 * rfact2r * fse3t(:,:,1) * tmask(:,:,1) ) ! surface downward dust depo of iron 
     154                IF( iom_use( "pdust" ) )   & 
     155                &  CALL iom_put( "pdust"  , dust(:,:) / ( wdust * rday )  * tmask(:,:,1) ) ! dust concentration at surface 
    162156            ENDIF 
     157         ELSE                                     
     158            IF( ln_diatrc )  & 
     159              &  trc2d(:,:,jp_pcs0_2d + 11) = zirondep(:,:,1) * 1.e+3 * rfact2r * fse3t(:,:,1) * tmask(:,:,1) 
    163160         ENDIF 
    164161         CALL wrk_dealloc( jpi, jpj,      zpdep, zsidep ) 
     
    190187         trn(:,:,:,jpfer) = trn(:,:,:,jpfer) + ironsed(:,:,:) * rfact2 
    191188         ! 
    192          IF( ln_diatrc .AND. lk_iomput .AND. jnt == nrdttrc )   & 
     189         IF( lk_iomput .AND. jnt == nrdttrc .AND. iom_use( "Ironsed" ) )   & 
    193190            &   CALL iom_put( "Ironsed", ironsed(:,:,:) * 1.e+3 * tmask(:,:,:) ) ! iron inputs from sediments 
    194191      ENDIF 
     
    199196         trn(:,:,:,jpfer) = trn(:,:,:,jpfer) + hydrofe(:,:,:) * rfact2 
    200197         ! 
    201          IF( ln_diatrc .AND. lk_iomput .AND. jnt == nrdttrc )   & 
     198         IF( lk_iomput .AND. jnt == nrdttrc .AND. iom_use( "HYDR" ) )   & 
    202199            &   CALL iom_put( "HYDR", hydrofe(:,:,:) * 1.e+3 * tmask(:,:,:) ) ! hydrothermal iron input 
    203200      ENDIF 
    204  
    205201 
    206202      ! OA: Warning, the following part is necessary, especially with Kriest 
     
    385381      END DO 
    386382 
    387   
    388       IF( ln_check_mass ) THEN 
    389         ! Global budget of N SMS : denitrification in the water column and in the sediment 
    390          !                          nitrogen fixation by the diazotrophs 
    391          ! -------------------------------------------------------------------------------- 
    392          zrdenittot   = glob_sum ( denitr(:,:,:) * rdenit * xnegtr(:,:,:) * cvol(:,:,:) ) 
    393          zsdenittot   = glob_sum ( zwork4(:,:)   * e1e2t(:,:) ) 
    394          znitrpottot  = glob_sum ( znitrpot(:,:,:) * nitrfix              * cvol(:,:,:) ) 
    395          IF( kt == nitend .AND. jnt == nrdttrc ) THEN 
    396             zfact = 1.e+3 * rfact2r * rno3 * ryyss * 14. / 1e12 
    397             IF(lwp) WRITE(numnit,9100) ndastp, znitrpottot * nitrfix * zfact, zrdenittot * zfact , zsdenittot * zfact 
     383      ! Global budget of N SMS : denitrification in the water column and in the sediment 
     384      !                          nitrogen fixation by the diazotrophs 
     385      ! -------------------------------------------------------------------------------- 
     386      zrdenittot   = glob_sum ( denitr(:,:,:) * rdenit * xnegtr(:,:,:) * cvol(:,:,:) ) 
     387      zsdenittot   = glob_sum ( zwork4(:,:)   * e1e2t(:,:) ) 
     388      znitrpottot  = glob_sum ( znitrpot(:,:,:) * nitrfix              * cvol(:,:,:) ) 
     389      zfact = 1.e+3 * rfact2r * rno3 * 14. / 1.e12 * ryyss   ! conversion molC/l/kt ----> TgN/m3/year 
     390      ! 
     391      IF( ln_check_mass .AND. ( kt == nitend .AND. jnt == nrdttrc ) .AND. ( lwp )  )  & 
     392         &  WRITE(numnit,9100) ndastp, znitrpottot * zfact  , & 
     393         &                             zrdenittot  * zfact  , & 
     394         &                             zsdenittot  * zfact 
     395      ! 
     396      IF( lk_iomput ) THEN 
     397         IF( jnt == nrdttrc ) THEN 
     398            zfact = 1.e+3 * rfact2r * rno3  !  conversion from molC/l/kt  to molN/m3/s 
     399            IF( iom_use("Nfix"   ) ) CALL iom_put( "Nfix"  , znitrpot(:,:,:) * nitrfix * zfact * tmask(:,:,:) )  ! nitrogen fixation  
     400            IF( iom_use("Sdenit" ) ) CALL iom_put( "Sdenit", zwork4(:,:) * zfact * tmask(:,:,1) )  ! Nitrate reduction in the sediments 
     401            IF( iom_use("tnfix"  ) ) CALL iom_put( "tnfix"  , znitrpottot * zfact  )               ! Global  nitrogen fixation 
     402            IF( iom_use("tdenit" ) ) CALL iom_put( "tdenit" , zrdenittot  * zfact  )               ! Total denitrification 
     403            IF( iom_use("INTNFIX") ) THEN   ! nitrogen fixation rate in ocean ( vertically integrated ) 
     404               zwork1(:,:) = 0. 
     405               DO jk = 1, jpkm1 
     406                 zwork1(:,:) = zwork1(:,:) + znitrpot(:,:,jk) * nitrfix * zfact * fse3t(:,:,jk) * tmask(:,:,jk) 
     407               ENDDO 
     408               CALL iom_put( "INTNFIX" , zwork1 )  
     409            ENDIF 
    398410         ENDIF 
    399        ENDIF 
    400       ! 
    401       IF( ln_diatrc ) THEN 
    402          zfact = 1.e+3 * rfact2r 
    403          IF( lk_iomput ) THEN 
    404             IF( jnt == nrdttrc ) THEN 
    405                CALL iom_put( "Nfix"  , znitrpot(:,:,:) * nitrfix * rno3 * zfact * tmask(:,:,:) )  ! nitrogen fixation  
    406                CALL iom_put( "Sdenit", zwork4(:,:)               * rno3 * zfact * tmask(:,:,1) )  ! Nitrate reduction in the sediments 
    407             ENDIF 
    408          ELSE 
    409             trc2d(:,:,jp_pcs0_2d + 12) = znitrpot(:,:,1) * nitrfix * zfact * fse3t(:,:,1) * tmask(:,:,1) 
    410          ENDIF 
     411      ELSE 
     412         IF( ln_diatrc )  & 
     413            &  trc2d(:,:,jp_pcs0_2d + 12) = znitrpot(:,:,1) * nitrfix * rno3 * 1.e+3 * rfact2r * fse3t(:,:,1) * tmask(:,:,1) 
    411414      ENDIF 
    412415      ! 
  • trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsink.F90

    r4624 r4996  
    4141#endif 
    4242 
    43    INTEGER  :: iksed  = 10 
     43   INTEGER  :: ik100 
    4444 
    4545#if  defined key_kriest 
     
    9494      REAL(wp) ::   zagg , zaggfe, zaggdoc, zaggdoc2, zaggdoc3 
    9595      REAL(wp) ::   zfact, zwsmax, zmax, zstep 
    96       REAL(wp) ::   zrfact2 
    97       INTEGER  ::   ik1 
    9896      CHARACTER (len=25) :: charout 
     97      REAL(wp), POINTER, DIMENSION(:,:,:) :: zw3d 
     98      REAL(wp), POINTER, DIMENSION(:,:  ) :: zw2d 
    9999      !!--------------------------------------------------------------------- 
    100100      ! 
     
    235235      END DO 
    236236 
    237      ! Total primary production per year 
    238      t_oce_co2_exp = t_oce_co2_exp + glob_sum( ( sinking(:,:,iksed+1) + sinking2(:,:,iksed+1) ) * e1e2t(:,:) * tmask(:,:,1) ) 
     237 
     238     ! Total carbon export per year 
     239     IF( iom_use( "tcexp" ) .OR. ( ln_check_mass .AND. kt == nitend .AND. jnt == nrdttrc )  )  & 
     240        &   t_oce_co2_exp = glob_sum( ( sinking(:,:,ik100) + sinking2(:,:,ik100) ) * e1e2t(:,:) * tmask(:,:,1) ) 
    239241     ! 
    240      IF( ln_diatrc ) THEN 
    241          zrfact2 = 1.e3 * rfact2r 
    242          ik1  = iksed + 1 
    243          IF( lk_iomput ) THEN 
    244            IF( jnt == nrdttrc ) THEN 
    245               CALL iom_put( "EPC100"  , ( sinking(:,:,ik1) + sinking2(:,:,ik1) ) * zrfact2 * tmask(:,:,1) ) ! Export of carbon at 100m 
    246               CALL iom_put( "EPFE100" , ( sinkfer(:,:,ik1) + sinkfer2(:,:,ik1) ) * zrfact2 * tmask(:,:,1) ) ! Export of iron at 100m 
    247               CALL iom_put( "EPCAL100",   sinkcal(:,:,ik1)                       * zrfact2 * tmask(:,:,1) ) ! Export of calcite  at 100m 
    248               CALL iom_put( "EPSI100" ,   sinksil(:,:,ik1)                       * zrfact2 * tmask(:,:,1) ) ! Export of biogenic silica at 100m 
    249            ENDIF 
    250          ELSE 
    251            trc2d(:,:,jp_pcs0_2d + 4) = sinking (:,:,ik1) * zrfact2 * tmask(:,:,1) 
    252            trc2d(:,:,jp_pcs0_2d + 5) = sinking2(:,:,ik1) * zrfact2 * tmask(:,:,1) 
    253            trc2d(:,:,jp_pcs0_2d + 6) = sinkfer (:,:,ik1) * zrfact2 * tmask(:,:,1) 
    254            trc2d(:,:,jp_pcs0_2d + 7) = sinkfer2(:,:,ik1) * zrfact2 * tmask(:,:,1) 
    255            trc2d(:,:,jp_pcs0_2d + 8) = sinksil (:,:,ik1) * zrfact2 * tmask(:,:,1) 
    256            trc2d(:,:,jp_pcs0_2d + 9) = sinkcal (:,:,ik1) * zrfact2 * tmask(:,:,1) 
     242     IF( lk_iomput ) THEN 
     243       IF( jnt == nrdttrc ) THEN 
     244          CALL wrk_alloc( jpi, jpj,      zw2d ) 
     245          CALL wrk_alloc( jpi, jpj, jpk, zw3d ) 
     246          zfact = 1.e+3 * rfact2r  !  conversion from mol/l/kt to  mol/m3/s 
     247          ! 
     248          IF( iom_use( "EPC100" ) )  THEN 
     249              zw2d(:,:) = ( sinking(:,:,ik100) + sinking2(:,:,ik100) ) * zfact * tmask(:,:,1) ! Export of carbon at 100m 
     250              CALL iom_put( "EPC100"  , zw2d ) 
     251          ENDIF 
     252          IF( iom_use( "EPFE100" ) )  THEN 
     253              zw2d(:,:) = ( sinkfer(:,:,ik100) + sinkfer2(:,:,ik100) ) * zfact * tmask(:,:,1) ! Export of iron at 100m 
     254              CALL iom_put( "EPFE100"  , zw2d ) 
     255          ENDIF 
     256          IF( iom_use( "EPCAL100" ) )  THEN 
     257              zw2d(:,:) = sinkcal(:,:,ik100) * zfact * tmask(:,:,1) ! Export of calcite at 100m 
     258              CALL iom_put( "EPCAL100"  , zw2d ) 
     259          ENDIF 
     260          IF( iom_use( "EPSI100" ) )  THEN 
     261              zw2d(:,:) =  sinksil(:,:,ik100) * zfact * tmask(:,:,1) ! Export of bigenic silica at 100m 
     262              CALL iom_put( "EPSI100"  , zw2d ) 
     263          ENDIF 
     264          IF( iom_use( "EXPC" ) )  THEN 
     265              zw3d(:,:,:) = ( sinking(:,:,:) + sinking2(:,:,:) ) * zfact * tmask(:,:,:) ! Export of carbon in the water column 
     266              CALL iom_put( "EXPC"  , zw3d ) 
     267          ENDIF 
     268          IF( iom_use( "EXPFE" ) )  THEN 
     269              zw3d(:,:,:) = ( sinkfer(:,:,:) + sinkfer2(:,:,:) ) * zfact * tmask(:,:,:) ! Export of iron  
     270              CALL iom_put( "EXPFE"  , zw3d ) 
     271          ENDIF 
     272          IF( iom_use( "EXPCAL" ) )  THEN 
     273              zw3d(:,:,:) = sinkcal(:,:,:) * zfact * tmask(:,:,:) ! Export of calcite  
     274              CALL iom_put( "EXPCAL"  , zw3d ) 
     275          ENDIF 
     276          IF( iom_use( "EXPSI" ) )  THEN 
     277              zw3d(:,:,:) = sinksil(:,:,:) * zfact * tmask(:,:,:) ! Export of bigenic silica 
     278              CALL iom_put( "EXPSI"  , zw3d ) 
     279          ENDIF 
     280          IF( iom_use( "tcexp" ) )  CALL iom_put( "tcexp" , t_oce_co2_exp * zfact )   ! molC/s 
     281          !  
     282          CALL wrk_dealloc( jpi, jpj,      zw2d ) 
     283          CALL wrk_dealloc( jpi, jpj, jpk, zw3d ) 
     284        ENDIF 
     285      ELSE 
     286         IF( ln_diatrc ) THEN 
     287            zfact = 1.e3 * rfact2r 
     288            trc2d(:,:,jp_pcs0_2d + 4) = sinking (:,:,ik100) * zfact * tmask(:,:,1) 
     289            trc2d(:,:,jp_pcs0_2d + 5) = sinking2(:,:,ik100) * zfact * tmask(:,:,1) 
     290            trc2d(:,:,jp_pcs0_2d + 6) = sinkfer (:,:,ik100) * zfact * tmask(:,:,1) 
     291            trc2d(:,:,jp_pcs0_2d + 7) = sinkfer2(:,:,ik100) * zfact * tmask(:,:,1) 
     292            trc2d(:,:,jp_pcs0_2d + 8) = sinksil (:,:,ik100) * zfact * tmask(:,:,1) 
     293            trc2d(:,:,jp_pcs0_2d + 9) = sinkcal (:,:,ik100) * zfact * tmask(:,:,1) 
    257294         ENDIF 
    258295      ENDIF 
     
    272309      !!                  ***  ROUTINE p4z_sink_init  *** 
    273310      !!---------------------------------------------------------------------- 
    274  
     311      INTEGER :: jk 
     312 
     313      ik100 = 10        !  last level where depth less than 100 m 
     314      DO jk = jpkm1, 1, -1 
     315         IF( gdept_1d(jk) > 100. )  ik100 = jk - 1 
     316      END DO 
     317      IF (lwp) WRITE(numout,*) 
     318      IF (lwp) WRITE(numout,*) ' Level corresponding to 100m depth ',  ik100 + 1 
     319      IF (lwp) WRITE(numout,*) 
     320      ! 
    275321      t_oce_co2_exp = 0._wp 
    276322      ! 
     
    300346      REAL(wp) :: zdiv , zdiv1, zdiv2, zdiv3, zdiv4, zdiv5 
    301347      REAL(wp) :: zval1, zval2, zval3, zval4 
    302       REAL(wp) :: zrfact2 
     348      REAL(wp) :: zfact 
    303349      INTEGER  :: ik1 
    304350      CHARACTER (len=25) :: charout 
    305351      REAL(wp), POINTER, DIMENSION(:,:,:) :: znum3d  
     352      REAL(wp), POINTER, DIMENSION(:,:,:) :: zw3d 
     353      REAL(wp), POINTER, DIMENSION(:,:  ) :: zw2d 
    306354      !!--------------------------------------------------------------------- 
    307355      ! 
     
    477525 
    478526     ! Total primary production per year 
    479      t_oce_co2_exp = t_oce_co2_exp + glob_sum( ( sinking(:,:,:) ) * cvol(:,:,:) ) 
     527     t_oce_co2_exp = t_oce_co2_exp + glob_sum( ( sinking(:,:,ik100) * e1e2t(:,:) * tmask(:,:,1) ) 
    480528     ! 
    481       IF( ln_diatrc ) THEN 
    482          ! 
    483          ik1 = iksed + 1 
    484          zrfact2 = 1.e3 * rfact2r 
    485          IF( jnt == nrdttrc ) THEN 
    486            CALL iom_put( "POCFlx"  , sinking (:,:,:)      * zrfact2 * tmask(:,:,:) )  ! POC export 
    487            CALL iom_put( "NumFlx"  , sinking2 (:,:,:)     * zrfact2 * tmask(:,:,:) )  ! Num export 
    488            CALL iom_put( "SiFlx"   , sinksil (:,:,:)      * zrfact2 * tmask(:,:,:) )  ! Silica export 
    489            CALL iom_put( "CaCO3Flx", sinkcal (:,:,:)      * zrfact2 * tmask(:,:,:) )  ! Calcite export 
    490            CALL iom_put( "xnum"    , znum3d  (:,:,:)                * tmask(:,:,:) )  ! Number of particles in aggregats 
    491            CALL iom_put( "W1"      , wsbio3  (:,:,:)                * tmask(:,:,:) )  ! sinking speed of POC 
    492            CALL iom_put( "W2"      , wsbio4  (:,:,:)                * tmask(:,:,:) )  ! sinking speed of aggregats 
     529     IF( lk_iomput ) THEN 
     530        IF( jnt == nrdttrc ) THEN 
     531          CALL wrk_alloc( jpi, jpj,      zw2d ) 
     532          CALL wrk_alloc( jpi, jpj, jpk, zw3d ) 
     533          zfact = 1.e+3 * rfact2r  !  conversion from mol/l/kt to  mol/m3/s 
     534          ! 
     535          IF( iom_use( "EPC100" ) )  THEN 
     536              zw2d(:,:) = sinking(:,:,ik100) * zfact * tmask(:,:,1) ! Export of carbon at 100m 
     537              CALL iom_put( "EPC100"  , zw2d ) 
     538          ENDIF 
     539          IF( iom_use( "EPN100" ) )  THEN 
     540              zw2d(:,:) = sinking2(:,:,ik100) * zfact * tmask(:,:,1) ! Export of number of aggregates ? 
     541              CALL iom_put( "EPN100"  , zw2d ) 
     542          ENDIF 
     543          IF( iom_use( "EPCAL100" ) )  THEN 
     544              zw2d(:,:) = sinkcal(:,:,ik100) * zfact * tmask(:,:,1) ! Export of calcite at 100m 
     545              CALL iom_put( "EPCAL100"  , zw2d ) 
     546          ENDIF 
     547          IF( iom_use( "EPSI100" ) )  THEN 
     548              zw2d(:,:) = sinksil(:,:,ik100) * zfact * tmask(:,:,1) ! Export of bigenic silica at 100m 
     549              CALL iom_put( "EPSI100"  , zw2d ) 
     550          ENDIF 
     551          IF( iom_use( "EXPC" ) )  THEN 
     552              zw3d(:,:,:) = sinking(:,:,:) * zfact * tmask(:,:,:) ! Export of carbon in the water column 
     553              CALL iom_put( "EXPC"  , zw3d ) 
     554          ENDIF 
     555          IF( iom_use( "EXPN" ) )  THEN 
     556              zw3d(:,:,:) = sinking(:,:,:) * zfact * tmask(:,:,:) ! Export of carbon in the water column 
     557              CALL iom_put( "EXPN"  , zw3d ) 
     558          ENDIF 
     559          IF( iom_use( "EXPCAL" ) )  THEN 
     560              zw3d(:,:,:) = sinkcal(:,:,:) * zfact * tmask(:,:,:) ! Export of calcite  
     561              CALL iom_put( "EXPCAL"  , zw3d ) 
     562          ENDIF 
     563          IF( iom_use( "EXPSI" ) )  THEN 
     564              zw3d(:,:,:) = sinksil(:,:,:) * zfact * tmask(:,:,:) ! Export of bigenic silica 
     565              CALL iom_put( "EXPSI"  , zw3d ) 
     566          ENDIF 
     567          IF( iom_use( "XNUM" ) )  THEN 
     568              zw3d(:,:,:) =  znum3d(:,:,:) * tmask(:,:,:) !  Number of particles on aggregats 
     569              CALL iom_put( "XNUM"  , zw3d ) 
     570          ENDIF 
     571          IF( iom_use( "WSC" ) )  THEN 
     572              zw3d(:,:,:) = wsbio3(:,:,:) * tmask(:,:,:) ! Sinking speed of carbon particles 
     573              CALL iom_put( "WSC"  , zw3d ) 
     574          ENDIF 
     575          IF( iom_use( "WSN" ) )  THEN 
     576              zw3d(:,:,:) = wsbio4(:,:,:) * tmask(:,:,:) ! Sinking speed of particles number 
     577              CALL iom_put( "WSN"  , zw3d ) 
     578          ENDIF 
     579          ! 
     580          CALL wrk_dealloc( jpi, jpj,      zw2d ) 
     581          CALL wrk_dealloc( jpi, jpj, jpk, zw3d ) 
     582      ELSE 
     583         IF( ln_diatrc ) THEN 
     584            zfact = 1.e3 * rfact2r 
     585            trc2d(:,:  ,jp_pcs0_2d + 4)  = sinking (:,:,ik100)  * zfact * tmask(:,:,1) 
     586            trc2d(:,:  ,jp_pcs0_2d + 5)  = sinking2(:,:,ik100)  * zfact * tmask(:,:,1) 
     587            trc2d(:,:  ,jp_pcs0_2d + 6)  = sinkfer (:,:,ik100)  * zfact * tmask(:,:,1) 
     588            trc2d(:,:  ,jp_pcs0_2d + 7)  = sinksil (:,:,ik100)  * zfact * tmask(:,:,1) 
     589            trc2d(:,:  ,jp_pcs0_2d + 8)  = sinkcal (:,:,ik100)  * zfact * tmask(:,:,1) 
     590            trc3d(:,:,:,jp_pcs0_3d + 11) = sinking (:,:,:)      * zfact * tmask(:,:,:) 
     591            trc3d(:,:,:,jp_pcs0_3d + 12) = sinking2(:,:,:)      * zfact * tmask(:,:,:) 
     592            trc3d(:,:,:,jp_pcs0_3d + 13) = sinksil (:,:,:)      * zfact * tmask(:,:,:) 
     593            trc3d(:,:,:,jp_pcs0_3d + 14) = sinkcal (:,:,:)      * zfact * tmask(:,:,:) 
     594            trc3d(:,:,:,jp_pcs0_3d + 15) = znum3d  (:,:,:)              * tmask(:,:,:) 
     595            trc3d(:,:,:,jp_pcs0_3d + 16) = wsbio3  (:,:,:)              * tmask(:,:,:) 
     596            trc3d(:,:,:,jp_pcs0_3d + 17) = wsbio4  (:,:,:)              * tmask(:,:,:) 
    493597         ENDIF 
    494 # if ! defined key_iomput 
    495          trc2d(:,:  ,jp_pcs0_2d + 4)  = sinking (:,:,ik1)    * zrfact2 * tmask(:,:,1) 
    496          trc2d(:,:  ,jp_pcs0_2d + 5)  = sinking2(:,:,ik1)    * zrfact2 * tmask(:,:,1) 
    497          trc2d(:,:  ,jp_pcs0_2d + 6)  = sinkfer (:,:,ik1)    * zrfact2 * tmask(:,:,1) 
    498          trc2d(:,:  ,jp_pcs0_2d + 7)  = sinksil (:,:,ik1)    * zrfact2 * tmask(:,:,1) 
    499          trc2d(:,:  ,jp_pcs0_2d + 8)  = sinkcal (:,:,ik1)    * zrfact2 * tmask(:,:,1) 
    500          trc3d(:,:,:,jp_pcs0_3d + 11) = sinking (:,:,:)      * zrfact2 * tmask(:,:,:) 
    501          trc3d(:,:,:,jp_pcs0_3d + 12) = sinking2(:,:,:)      * zrfact2 * tmask(:,:,:) 
    502          trc3d(:,:,:,jp_pcs0_3d + 13) = sinksil (:,:,:)      * zrfact2 * tmask(:,:,:) 
    503          trc3d(:,:,:,jp_pcs0_3d + 14) = sinkcal (:,:,:)      * zrfact2 * tmask(:,:,:) 
    504          trc3d(:,:,:,jp_pcs0_3d + 15) = znum3d  (:,:,:)                * tmask(:,:,:) 
    505          trc3d(:,:,:,jp_pcs0_3d + 16) = wsbio3  (:,:,:)                * tmask(:,:,:) 
    506          trc3d(:,:,:,jp_pcs0_3d + 17) = wsbio4  (:,:,:)                * tmask(:,:,:) 
    507 # endif 
    508         ! 
    509598      ENDIF 
     599 
    510600      ! 
    511601      IF(ln_ctl)   THEN  ! print mean trends (used for debugging) 
     
    663753      END DO 
    664754      ! 
     755      ik100 = 10        !  last level where depth less than 100 m 
     756      DO jk = jpkm1, 1, -1 
     757         IF( gdept_1d(jk) > 100. )  iksed = jk - 1 
     758      END DO 
     759      IF (lwp) WRITE(numout,*) 
     760      IF (lwp) WRITE(numout,*) ' Level corresponding to 100m depth ',  ik100 + 1 
     761      IF (lwp) WRITE(numout,*) 
     762      ! 
    665763      t_oce_co2_exp = 0._wp 
    666764      ! 
  • trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsms.F90

    r4990 r4996  
    120120         ENDDO 
    121121      ENDIF 
    122  
    123122      CALL p4z_lys( kt )             ! Compute CaCO3 saturation 
    124123      CALL p4z_flx( kt )             ! Compute surface fluxes 
     
    151150      END IF 
    152151      ! 
    153       CALL p4z_chk_mass( kt ) ! Mass conservation checking 
     152      IF( lk_iomput .OR. ln_check_mass )  CALL p4z_chk_mass( kt ) ! Mass conservation checking 
    154153 
    155154      IF ( lwm .AND. kt == nittrc000 ) CALL FLUSH    ( numonp )     ! flush output namelist PISCES 
     
    328327         ENDIF 
    329328         ! 
     329         IF( iom_varid( numrtr, 'tcflxcum', ldstop = .FALSE. ) > 0 ) THEN  ! cumulative total flux of carbon 
     330            CALL iom_get( numrtr, 'tcflxcum' , t_oce_co2_flx_cum  ) 
     331         ELSE 
     332            t_oce_co2_flx_cum = 0._wp 
     333         ENDIF 
     334         ! 
    330335      ELSEIF( TRIM(cdrw) == 'WRITE' ) THEN 
    331336         IF( kt == nitrst ) THEN 
     
    337342         CALL iom_rstput( kt, nitrst, numrtw, 'Silicalim', xksi(:,:) ) 
    338343         CALL iom_rstput( kt, nitrst, numrtw, 'Silicamax', xksimax(:,:) ) 
     344         CALL iom_rstput( kt, nitrst, numrtw, 'tcflxcum', t_oce_co2_flx_cum ) 
    339345      ENDIF 
    340346      ! 
     
    398404      !!--------------------------------------------------------------------- 
    399405      ! 
    400       INTEGER, INTENT( in ) ::   kt      ! ocean time-step index       
     406      INTEGER , INTENT( in ) ::   kt      ! ocean time-step index       
     407      REAL(wp)               ::  zfact        
    401408      !! 
    402409      !!--------------------------------------------------------------------- 
     
    409416      ENDIF 
    410417 
    411       IF( ln_check_mass .AND. kt == nitend ) THEN      !   Compute the budget of NO3, ALK, Si, Fer 
     418      IF( iom_use( "pno3tot" ) .OR. ( ln_check_mass .AND. kt == nitend )  ) THEN 
     419         !   Compute the budget of NO3, ALK, Si, Fer 
    412420         no3budget = glob_sum( (   trn(:,:,:,jpno3) + trn(:,:,:,jpnh4)  & 
    413421            &                    + trn(:,:,:,jpphy) + trn(:,:,:,jpdia)  & 
     
    417425            &                    + trn(:,:,:,jpgoc)                     & 
    418426#endif 
    419             &                    + trn(:,:,:,jpdoc)                     ) * cvol(:,:,:)  )  
    420          !  
     427            &                    + trn(:,:,:,jpdoc)                     ) * cvol(:,:,:)  ) 
     428         ! 
     429         no3budget = no3budget / areatot 
     430         CALL iom_put( "pno3tot", no3budget ) 
     431      ENDIF 
     432      ! 
     433      IF( iom_use( "psiltot" ) .OR.  ( ln_check_mass .AND. kt == nitend )  ) THEN 
    421434         silbudget = glob_sum( (   trn(:,:,:,jpsil) + trn(:,:,:,jpgsi)  & 
    422435            &                    + trn(:,:,:,jpdsi)                     ) * cvol(:,:,:)  ) 
    423          !  
     436         ! 
     437         silbudget = silbudget / areatot 
     438         CALL iom_put( "psiltot", silbudget ) 
     439      ENDIF 
     440      ! 
     441      IF( iom_use( "palktot" ) .OR.  ( ln_check_mass .AND. kt == nitend )  ) THEN 
    424442         alkbudget = glob_sum( (   trn(:,:,:,jpno3) * rno3              & 
    425443            &                    + trn(:,:,:,jptal)                     & 
    426444            &                    + trn(:,:,:,jpcal) * 2.                ) * cvol(:,:,:)  ) 
    427          !  
     445         ! 
     446         alkbudget = alkbudget / areatot 
     447         CALL iom_put( "palktot", alkbudget ) 
     448      ENDIF 
     449      ! 
     450      IF( iom_use( "pfertot" ) .OR.  ( ln_check_mass .AND. kt == nitend )  ) THEN 
    428451         ferbudget = glob_sum( (   trn(:,:,:,jpfer) + trn(:,:,:,jpnfe)  & 
    429452            &                    + trn(:,:,:,jpdfe)                     & 
     
    434457            &                    + trn(:,:,:,jpzoo) * ferat3            & 
    435458            &                    + trn(:,:,:,jpmes) * ferat3            ) * cvol(:,:,:)  ) 
    436  
    437          ! 
     459         ! 
     460         ferbudget = ferbudget / areatot 
     461         CALL iom_put( "pfertot", ferbudget ) 
     462      ENDIF 
     463      ! 
     464      IF( ln_check_mass .AND. kt == nitend ) THEN   ! Compute the budget of NO3, ALK, Si, Fer 
     465         zfact = rfact2r * 12. / 1.e15 * ryyss    ! conversion molC/kt --> PgC/year 
    438466         t_atm_co2_flx  = t_atm_co2_flx / glob_sum( e1e2t(:,:) ) 
    439          t_oce_co2_flx  = t_oce_co2_flx         * 12. / 1.e15 * (-1 ) 
    440          tpp            = tpp           * 1000. * 12. / 1.E15 
    441          t_oce_co2_exp  = t_oce_co2_exp * 1000. * 12. / 1.E15 
    442          ! 
    443          no3budget = no3budget / areatot 
    444          silbudget = silbudget / areatot 
    445          alkbudget = alkbudget / areatot 
    446          ferbudget = ferbudget / areatot 
    447          ! 
    448          IF(lwp) THEN 
    449             WRITE(numco2,9000) ndastp, t_atm_co2_flx, t_oce_co2_flx, tpp, t_oce_co2_exp 
    450             WRITE(numnut,9500) ndastp, alkbudget, no3budget, silbudget, ferbudget 
    451          ENDIF 
    452          ! 
    453       ENDIF 
    454        ! 
     467         t_oce_co2_flx  = t_oce_co2_flx         * zfact * (-1 ) 
     468         tpp            = tpp           * 1000. * zfact 
     469         t_oce_co2_exp  = t_oce_co2_exp * 1000. * zfact 
     470         IF( lwp ) WRITE(numco2,9000) ndastp, t_atm_co2_flx, t_oce_co2_flx, tpp, t_oce_co2_exp 
     471         IF( lwp ) WRITE(numnut,9500) ndastp, alkbudget        * 1.e+06, & 
     472             &                                no3budget * rno3 * 1.e+06, & 
     473             &                                silbudget        * 1.e+06, & 
     474             &                                ferbudget        * 1.e+09 
     475      ENDIF 
     476      ! 
    455477 9000  FORMAT(i8,f10.5,e18.10,f10.5,f10.5) 
    456  9500  FORMAT(i8,4e18.10)      
     478 9500  FORMAT(i8,4e18.10) 
    457479       ! 
    458480   END SUBROUTINE p4z_chk_mass 
  • trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/sms_pisces.F90

    r4529 r4996  
    3636   REAL(wp) ::   rfact2, rfact2r   !: ??? 
    3737   REAL(wp) ::   xstep             !: Time step duration for biology 
     38   REAL(wp) ::   ryyss             !: number of seconds per year  
     39   REAL(wp) ::   r1_ryyss          !: inverse number of seconds per year  
     40 
    3841 
    3942   !!*  Biological parameters  
     
    5356   REAL(wp) ::  t_oce_co2_exp      !: total carbon export 
    5457   REAL(wp) ::  t_oce_co2_flx      !: Total ocean carbon flux 
     58   REAL(wp) ::  t_oce_co2_flx_cum  !: Cumulative Total ocean carbon flux 
    5559   REAL(wp) ::  t_atm_co2_flx      !: global mean of atmospheric pco2 
    5660 
  • trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/trcini_pisces.F90

    r4521 r4996  
    100100      IF( lk_mpp    )   CALL mpp_sum( ierr ) 
    101101      IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'pisces_alloc: unable to allocate PISCES arrays' ) 
     102      ! 
     103      ryyss    = nyear_len(1) * rday    ! number of seconds per year 
     104      r1_ryyss = 1. / ryyss 
    102105      ! 
    103106 
  • trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/trcwri_pisces.F90

    r4292 r4996  
    3030      !! ** Purpose :   output passive tracers fields  
    3131      !!--------------------------------------------------------------------- 
    32       CHARACTER (len=20)   :: cltra 
    33       REAL(wp)             :: zrfact 
    34       INTEGER              :: jn 
     32      CHARACTER (len=20)           :: cltra 
     33      REAL(wp)                     :: zfact 
     34      INTEGER                      :: ji, jj, jk, jn 
     35      REAL(wp), DIMENSION(jpi,jpj) :: zdic, zo2min, zdepo2min 
    3536      !!--------------------------------------------------------------------- 
    3637  
     
    4041      DO jn = jp_pcs0, jp_pcs1 
    4142         cltra = TRIM( ctrcnm(jn) )                  ! short title for tracer 
    42          IF( lk_vvl ) THEN 
    43             CALL iom_put( cltra, trn(:,:,:,jn) * fse3t_n(:,:,:) ) 
    44          ELSE 
    45             CALL iom_put( cltra, trn(:,:,:,jn) ) 
    46          ENDIF 
    47          CALL iom_put( cltra, trn(:,:,:,jn) * zrfact ) 
     43         CALL iom_put( cltra, trn(:,:,:,jn) ) 
    4844      END DO 
    4945#else 
    5046      DO jn = jp_pcs0, jp_pcs1 
    51          zrfact = 1.0e+6  
    52          IF( jn == jpno3 .OR. jn == jpnh4 ) zrfact = rno3 * 1.0e+6  
    53          IF( jn == jppo4  )                 zrfact = po4r * 1.0e+6 
     47         zfact = 1.0e+6  
     48         IF( jn == jpno3 .OR. jn == jpnh4 ) zfact = rno3 * 1.0e+6  
     49         IF( jn == jppo4  )                 zfact = po4r * 1.0e+6 
    5450         cltra = TRIM( ctrcnm(jn) )                  ! short title for tracer 
    55          IF( lk_vvl ) THEN 
    56             CALL iom_put( cltra, trn(:,:,:,jn) * fse3t_n(:,:,:) * zrfact ) 
    57          ELSE 
    58             CALL iom_put( cltra, trn(:,:,:,jn) * zrfact ) 
    59          ENDIF 
     51         IF( iom_use( cltra ) )  CALL iom_put( cltra, trn(:,:,:,jn) * zfact ) 
    6052      END DO 
     53 
     54      IF( iom_use( "INTDIC" ) ) THEN                     !   DIC content in kg/m2 
     55         zdic(:,:) = 0. 
     56         DO jk = 1, jpkm1 
     57            zdic(:,:) = zdic(:,:) + trn(:,:,jk,jpdic) * fse3t(:,:,jk) * tmask(:,:,jk) * 12. 
     58         ENDDO 
     59         CALL iom_put( 'INTDIC', zdic )      
     60      ENDIF 
     61      ! 
     62      IF( iom_use( "O2MIN" ) .OR. iom_use ( "ZO2MIN" ) ) THEN  ! Oxygen minimum concentration and depth  
     63         zo2min   (:,:) = trn(:,:,1,jpoxy) * tmask(:,:,1) 
     64         zdepo2min(:,:) = fsdepw(:,:,1)    * tmask(:,:,1) 
     65         DO jk = 2, jpkm1 
     66            DO jj = 1, jpj 
     67               DO ji = 1, jpi 
     68                  IF( tmask(ji,jj,jk) == 1 ) then 
     69                     IF( trn(ji,jj,jk,jpoxy) < zo2min(ji,jj) ) then 
     70                        zo2min   (ji,jj) = trn(ji,jj,jk,jpoxy) 
     71                        zdepo2min(ji,jj) = fsdepw(ji,jj,jk) 
     72                     ENDIF 
     73                  ENDIF 
     74               END DO 
     75            END DO 
     76         END DO 
     77         ! 
     78         CALL iom_put('O2MIN' , zo2min     )                              ! oxygen minimum concentration 
     79         CALL iom_put('ZO2MIN', zdepo2min  )                              ! depth of oxygen minimum concentration 
     80          ! 
     81      ENDIF 
    6182#endif 
    6283      ! 
Note: See TracChangeset for help on using the changeset viewer.