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 5707 for branches/NERC/dev_r5107_NOC_MEDUSA/NEMOGCM/NEMO/TOP_SRC/trcrst.F90 – NEMO

Ignore:
Timestamp:
2015-08-26T14:18:46+02:00 (9 years ago)
Author:
acc
Message:

JPALM --25-08-2015 -- add MEDUSA in the branch. MEDUSA version already up-to-date with this trunk revision

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/NERC/dev_r5107_NOC_MEDUSA/NEMOGCM/NEMO/TOP_SRC/trcrst.F90

    r4990 r5707  
    2828   USE iom 
    2929   USE daymod 
     30   !! AXY (05/11/13): need these for MEDUSA to input/output benthic reservoirs 
     31   USE sms_medusa 
     32   USE trcsms_medusa 
     33   !! 
    3034   IMPLICIT NONE 
    3135   PRIVATE 
     
    8892   SUBROUTINE trc_rst_read 
    8993      !!---------------------------------------------------------------------- 
    90       !!                    ***  trc_rst_opn  *** 
     94      !!                    ***  trc_read_opn  *** 
    9195      !! 
    9296      !! ** purpose  :   read passive tracer fields in restart files 
    9397      !!---------------------------------------------------------------------- 
    9498      INTEGER  ::  jn      
     99      !! AXY (05/11/13): temporary variables 
     100      REAL(wp) ::    fq0,fq1,fq2 
    95101 
    96102      !!---------------------------------------------------------------------- 
     
    108114         CALL iom_get( numrtr, jpdom_autoglo, 'TRB'//ctrcnm(jn), trb(:,:,:,jn) ) 
    109115      END DO 
     116 
     117      !! AXY (09/06/14): the ARCHER version of MEDUSA-2 does not include an equivalent 
     118      !!                 call to MEDUSA-2 at this point; this suggests that the FCM 
     119      !!                 version of NEMO date significantly earlier than the current 
     120      !!                 version 
     121 
     122#if defined key_medusa 
     123      !! AXY (13/01/12): check if the restart contains sediment fields; 
     124      !!                 this is only relevant for simulations that include 
     125      !!                 biogeochemistry and are restarted from earlier runs 
     126      !!                 in which there was no sediment component 
     127      !! 
     128      IF( iom_varid( numrtr, 'B_SED_N', ldstop = .FALSE. ) > 0 ) THEN 
     129         !! YES; in which case read them 
     130         !! 
     131         IF(lwp) WRITE(numout,*) ' MEDUSA sediment fields present - reading in ...' 
     132         CALL iom_get( numrtr, jpdom_autoglo, 'B_SED_N',  zb_sed_n(:,:)  ) 
     133         CALL iom_get( numrtr, jpdom_autoglo, 'N_SED_N',  zn_sed_n(:,:)  ) 
     134         CALL iom_get( numrtr, jpdom_autoglo, 'B_SED_FE', zb_sed_fe(:,:) ) 
     135         CALL iom_get( numrtr, jpdom_autoglo, 'N_SED_FE', zn_sed_fe(:,:) ) 
     136         CALL iom_get( numrtr, jpdom_autoglo, 'B_SED_SI', zb_sed_si(:,:) ) 
     137         CALL iom_get( numrtr, jpdom_autoglo, 'N_SED_SI', zn_sed_si(:,:) ) 
     138         CALL iom_get( numrtr, jpdom_autoglo, 'B_SED_C',  zb_sed_c(:,:)  ) 
     139         CALL iom_get( numrtr, jpdom_autoglo, 'N_SED_C',  zn_sed_c(:,:)  ) 
     140         CALL iom_get( numrtr, jpdom_autoglo, 'B_SED_CA', zb_sed_ca(:,:) ) 
     141         CALL iom_get( numrtr, jpdom_autoglo, 'N_SED_CA', zn_sed_ca(:,:) ) 
     142      ELSE 
     143         !! NO; in which case set them to zero 
     144         !! 
     145         IF(lwp) WRITE(numout,*) ' MEDUSA sediment fields absent - setting to zero ...' 
     146         zb_sed_n(:,:)  = 0.0   !! organic N 
     147         zn_sed_n(:,:)  = 0.0 
     148         zb_sed_fe(:,:) = 0.0   !! organic Fe 
     149         zn_sed_fe(:,:) = 0.0 
     150         zb_sed_si(:,:) = 0.0   !! inorganic Si 
     151         zn_sed_si(:,:) = 0.0 
     152         zb_sed_c(:,:)  = 0.0   !! organic C 
     153         zn_sed_c(:,:)  = 0.0 
     154         zb_sed_ca(:,:) = 0.0   !! inorganic C 
     155         zn_sed_ca(:,:) = 0.0 
     156      ENDIF 
     157      !! 
     158      !! calculate stats on these fields 
     159      IF(lwp) WRITE(numout,*) ' MEDUSA sediment field stats (min, max, sum) ...' 
     160      fq0 = MINVAL(zn_sed_n(:,:)) 
     161      fq1 = MAXVAL(zn_sed_n(:,:)) 
     162      fq2 = SUM(zn_sed_n(:,:)) 
     163      if (lwp) write (numout,'(a,3f15.5)') 'Sediment  N ', & 
     164         &        fq0, fq1, fq2 
     165      fq0 = MINVAL(zn_sed_fe(:,:)) 
     166      fq1 = MAXVAL(zn_sed_fe(:,:)) 
     167      fq2 = SUM(zn_sed_fe(:,:)) 
     168      if (lwp) write (numout,'(a,3f15.5)') 'Sediment Fe ', & 
     169         &        fq0, fq1, fq2 
     170      fq0 = MINVAL(zn_sed_si(:,:)) 
     171      fq1 = MAXVAL(zn_sed_si(:,:)) 
     172      fq2 = SUM(zn_sed_si(:,:)) 
     173      if (lwp) write (numout,'(a,3f15.5)') 'Sediment Si ', & 
     174         &        fq0, fq1, fq2 
     175      fq0 = MINVAL(zn_sed_c(:,:)) 
     176      fq1 = MAXVAL(zn_sed_c(:,:)) 
     177      fq2 = SUM(zn_sed_c(:,:)) 
     178      if (lwp) write (numout,'(a,3f15.5)') 'Sediment  C ', & 
     179         &        fq0, fq1, fq2 
     180      fq0 = MINVAL(zn_sed_ca(:,:)) 
     181      fq1 = MAXVAL(zn_sed_ca(:,:)) 
     182      fq2 = SUM(zn_sed_ca(:,:)) 
     183      if (lwp) write (numout,'(a,3f15.5)') 'Sediment Ca ', & 
     184         &        fq0, fq1, fq2 
     185#endif 
     186  
    110187      ! 
    111188   END SUBROUTINE trc_rst_read 
     
    121198      INTEGER  :: jn 
    122199      REAL(wp) :: zarak0 
     200      !! AXY (05/11/13): temporary variables 
     201      REAL(wp) ::    fq0,fq1,fq2 
    123202      !!---------------------------------------------------------------------- 
    124203      ! 
     
    133212         CALL iom_rstput( kt, nitrst, numrtw, 'TRB'//ctrcnm(jn), trb(:,:,:,jn) ) 
    134213      END DO 
     214 
     215      !! AXY (09/06/14): the ARCHER version of MEDUSA-2 does not include an equivalent 
     216      !!                 call to MEDUSA-2 at this point; this suggests that the FCM 
     217      !!                 version of NEMO date significantly earlier than the current 
     218      !!                 version 
     219 
     220#if defined key_medusa 
     221      !! AXY (13/01/12): write out "before" and "now" state of seafloor 
     222      !!                 sediment pools into restart; this happens 
     223      !!                 whether or not the pools are to be used by 
     224      !!                 MEDUSA (which is controlled by a switch in the 
     225      !!                 namelist_top file) 
     226      !! 
     227      IF(lwp) WRITE(numout,*) ' MEDUSA sediment fields - writing out ...' 
     228      CALL iom_rstput( kt, nitrst, numrtw, 'B_SED_N',  zb_sed_n(:,:)  ) 
     229      CALL iom_rstput( kt, nitrst, numrtw, 'N_SED_N',  zn_sed_n(:,:)  ) 
     230      CALL iom_rstput( kt, nitrst, numrtw, 'B_SED_FE', zb_sed_fe(:,:) ) 
     231      CALL iom_rstput( kt, nitrst, numrtw, 'N_SED_FE', zn_sed_fe(:,:) ) 
     232      CALL iom_rstput( kt, nitrst, numrtw, 'B_SED_SI', zb_sed_si(:,:) ) 
     233      CALL iom_rstput( kt, nitrst, numrtw, 'N_SED_SI', zn_sed_si(:,:) ) 
     234      CALL iom_rstput( kt, nitrst, numrtw, 'B_SED_C',  zb_sed_c(:,:)  ) 
     235      CALL iom_rstput( kt, nitrst, numrtw, 'N_SED_C',  zn_sed_c(:,:)  ) 
     236      CALL iom_rstput( kt, nitrst, numrtw, 'B_SED_CA', zb_sed_ca(:,:) ) 
     237      CALL iom_rstput( kt, nitrst, numrtw, 'N_SED_CA', zn_sed_ca(:,:) ) 
     238      !! 
     239      !! calculate stats on these fields 
     240      IF(lwp) WRITE(numout,*) ' MEDUSA sediment field stats (min, max, sum) ...' 
     241      fq0 = MINVAL(zn_sed_n(:,:)) 
     242      fq1 = MAXVAL(zn_sed_n(:,:)) 
     243      fq2 = SUM(zn_sed_n(:,:)) 
     244      if (lwp) write (numout,'(a,3f15.5)') 'Sediment  N ', & 
     245         &        fq0, fq1, fq2 
     246      fq0 = MINVAL(zn_sed_fe(:,:)) 
     247      fq1 = MAXVAL(zn_sed_fe(:,:)) 
     248      fq2 = SUM(zn_sed_fe(:,:)) 
     249      if (lwp) write (numout,'(a,3f15.5)') 'Sediment Fe ', & 
     250         &        fq0, fq1, fq2 
     251      fq0 = MINVAL(zn_sed_si(:,:)) 
     252      fq1 = MAXVAL(zn_sed_si(:,:)) 
     253      fq2 = SUM(zn_sed_si(:,:)) 
     254      if (lwp) write (numout,'(a,3f15.5)') 'Sediment Si ', & 
     255         &        fq0, fq1, fq2 
     256      fq0 = MINVAL(zn_sed_c(:,:)) 
     257      fq1 = MAXVAL(zn_sed_c(:,:)) 
     258      fq2 = SUM(zn_sed_c(:,:)) 
     259      if (lwp) write (numout,'(a,3f15.5)') 'Sediment  C ', & 
     260         &        fq0, fq1, fq2 
     261      fq0 = MINVAL(zn_sed_ca(:,:)) 
     262      fq1 = MAXVAL(zn_sed_ca(:,:)) 
     263      fq2 = SUM(zn_sed_ca(:,:)) 
     264      if (lwp) write (numout,'(a,3f15.5)') 'Sediment Ca ', & 
     265         &        fq0, fq1, fq2 
     266#endif 
     267 
    135268      ! 
    136269      IF( kt == nitrst ) THEN 
Note: See TracChangeset for help on using the changeset viewer.