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

Ignore:
Timestamp:
2015-09-10T18:48:32+02:00 (9 years ago)
Author:
jpalmier
Message:

JPALM -- 10-09-2015 -- add MEDUSA in the branch ; adapted TOP_SRC to MEDUSA ; remove some svn keywords in the branch

File:
1 edited

Legend:

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

    • Property svn:keywords deleted
    r5513 r5726  
    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 
     
    102106      !!---------------------------------------------------------------------- 
    103107      INTEGER  ::  jn      
     108      !! AXY (05/11/13): temporary variables 
     109      REAL(wp) ::    fq0,fq1,fq2 
    104110 
    105111      !!---------------------------------------------------------------------- 
     
    117123         CALL iom_get( numrtr, jpdom_autoglo, 'TRB'//ctrcnm(jn), trb(:,:,:,jn) ) 
    118124      END DO 
     125 
     126      !! AXY (09/06/14): the ARCHER version of MEDUSA-2 does not include an equivalent 
     127      !!                 call to MEDUSA-2 at this point; this suggests that the FCM 
     128      !!                 version of NEMO date significantly earlier than the current 
     129      !!                 version 
     130 
     131#if defined key_medusa 
     132      !! AXY (13/01/12): check if the restart contains sediment fields; 
     133      !!                 this is only relevant for simulations that include 
     134      !!                 biogeochemistry and are restarted from earlier runs 
     135      !!                 in which there was no sediment component 
     136      !! 
     137      IF( iom_varid( numrtr, 'B_SED_N', ldstop = .FALSE. ) > 0 ) THEN 
     138         !! YES; in which case read them 
     139         !! 
     140         IF(lwp) WRITE(numout,*) ' MEDUSA sediment fields present - reading in ...' 
     141         CALL iom_get( numrtr, jpdom_autoglo, 'B_SED_N',  zb_sed_n(:,:)  ) 
     142         CALL iom_get( numrtr, jpdom_autoglo, 'N_SED_N',  zn_sed_n(:,:)  ) 
     143         CALL iom_get( numrtr, jpdom_autoglo, 'B_SED_FE', zb_sed_fe(:,:) ) 
     144         CALL iom_get( numrtr, jpdom_autoglo, 'N_SED_FE', zn_sed_fe(:,:) ) 
     145         CALL iom_get( numrtr, jpdom_autoglo, 'B_SED_SI', zb_sed_si(:,:) ) 
     146         CALL iom_get( numrtr, jpdom_autoglo, 'N_SED_SI', zn_sed_si(:,:) ) 
     147         CALL iom_get( numrtr, jpdom_autoglo, 'B_SED_C',  zb_sed_c(:,:)  ) 
     148         CALL iom_get( numrtr, jpdom_autoglo, 'N_SED_C',  zn_sed_c(:,:)  ) 
     149         CALL iom_get( numrtr, jpdom_autoglo, 'B_SED_CA', zb_sed_ca(:,:) ) 
     150         CALL iom_get( numrtr, jpdom_autoglo, 'N_SED_CA', zn_sed_ca(:,:) ) 
     151      ELSE 
     152         !! NO; in which case set them to zero 
     153         !! 
     154         IF(lwp) WRITE(numout,*) ' MEDUSA sediment fields absent - setting to zero ...' 
     155         zb_sed_n(:,:)  = 0.0   !! organic N 
     156         zn_sed_n(:,:)  = 0.0 
     157         zb_sed_fe(:,:) = 0.0   !! organic Fe 
     158         zn_sed_fe(:,:) = 0.0 
     159         zb_sed_si(:,:) = 0.0   !! inorganic Si 
     160         zn_sed_si(:,:) = 0.0 
     161         zb_sed_c(:,:)  = 0.0   !! organic C 
     162         zn_sed_c(:,:)  = 0.0 
     163         zb_sed_ca(:,:) = 0.0   !! inorganic C 
     164         zn_sed_ca(:,:) = 0.0 
     165      ENDIF 
     166      !! 
     167      !! calculate stats on these fields 
     168      IF(lwp) WRITE(numout,*) ' MEDUSA sediment field stats (min, max, sum) ...' 
     169      fq0 = MINVAL(zn_sed_n(:,:)) 
     170      fq1 = MAXVAL(zn_sed_n(:,:)) 
     171      fq2 = SUM(zn_sed_n(:,:)) 
     172      if (lwp) write (numout,'(a,3f15.5)') 'Sediment  N ', & 
     173         &        fq0, fq1, fq2 
     174      fq0 = MINVAL(zn_sed_fe(:,:)) 
     175      fq1 = MAXVAL(zn_sed_fe(:,:)) 
     176      fq2 = SUM(zn_sed_fe(:,:)) 
     177      if (lwp) write (numout,'(a,3f15.5)') 'Sediment Fe ', & 
     178         &        fq0, fq1, fq2 
     179      fq0 = MINVAL(zn_sed_si(:,:)) 
     180      fq1 = MAXVAL(zn_sed_si(:,:)) 
     181      fq2 = SUM(zn_sed_si(:,:)) 
     182      if (lwp) write (numout,'(a,3f15.5)') 'Sediment Si ', & 
     183         &        fq0, fq1, fq2 
     184      fq0 = MINVAL(zn_sed_c(:,:)) 
     185      fq1 = MAXVAL(zn_sed_c(:,:)) 
     186      fq2 = SUM(zn_sed_c(:,:)) 
     187      if (lwp) write (numout,'(a,3f15.5)') 'Sediment  C ', & 
     188         &        fq0, fq1, fq2 
     189      fq0 = MINVAL(zn_sed_ca(:,:)) 
     190      fq1 = MAXVAL(zn_sed_ca(:,:)) 
     191      fq2 = SUM(zn_sed_ca(:,:)) 
     192      if (lwp) write (numout,'(a,3f15.5)') 'Sediment Ca ', & 
     193         &        fq0, fq1, fq2 
     194#endif 
     195  
    119196      ! 
    120197   END SUBROUTINE trc_rst_read 
     
    130207      INTEGER  :: jn 
    131208      REAL(wp) :: zarak0 
     209      !! AXY (05/11/13): temporary variables 
     210      REAL(wp) ::    fq0,fq1,fq2 
    132211      !!---------------------------------------------------------------------- 
    133212      ! 
     
    142221         CALL iom_rstput( kt, nitrst, numrtw, 'TRB'//ctrcnm(jn), trb(:,:,:,jn) ) 
    143222      END DO 
     223 
     224      !! AXY (09/06/14): the ARCHER version of MEDUSA-2 does not include an equivalent 
     225      !!                 call to MEDUSA-2 at this point; this suggests that the FCM 
     226      !!                 version of NEMO date significantly earlier than the current 
     227      !!                 version 
     228 
     229#if defined key_medusa 
     230      !! AXY (13/01/12): write out "before" and "now" state of seafloor 
     231      !!                 sediment pools into restart; this happens 
     232      !!                 whether or not the pools are to be used by 
     233      !!                 MEDUSA (which is controlled by a switch in the 
     234      !!                 namelist_top file) 
     235      !! 
     236      IF(lwp) WRITE(numout,*) ' MEDUSA sediment fields - writing out ...' 
     237      CALL iom_rstput( kt, nitrst, numrtw, 'B_SED_N',  zb_sed_n(:,:)  ) 
     238      CALL iom_rstput( kt, nitrst, numrtw, 'N_SED_N',  zn_sed_n(:,:)  ) 
     239      CALL iom_rstput( kt, nitrst, numrtw, 'B_SED_FE', zb_sed_fe(:,:) ) 
     240      CALL iom_rstput( kt, nitrst, numrtw, 'N_SED_FE', zn_sed_fe(:,:) ) 
     241      CALL iom_rstput( kt, nitrst, numrtw, 'B_SED_SI', zb_sed_si(:,:) ) 
     242      CALL iom_rstput( kt, nitrst, numrtw, 'N_SED_SI', zn_sed_si(:,:) ) 
     243      CALL iom_rstput( kt, nitrst, numrtw, 'B_SED_C',  zb_sed_c(:,:)  ) 
     244      CALL iom_rstput( kt, nitrst, numrtw, 'N_SED_C',  zn_sed_c(:,:)  ) 
     245      CALL iom_rstput( kt, nitrst, numrtw, 'B_SED_CA', zb_sed_ca(:,:) ) 
     246      CALL iom_rstput( kt, nitrst, numrtw, 'N_SED_CA', zn_sed_ca(:,:) ) 
     247      !! 
     248      !! calculate stats on these fields 
     249      IF(lwp) WRITE(numout,*) ' MEDUSA sediment field stats (min, max, sum) ...' 
     250      fq0 = MINVAL(zn_sed_n(:,:)) 
     251      fq1 = MAXVAL(zn_sed_n(:,:)) 
     252      fq2 = SUM(zn_sed_n(:,:)) 
     253      if (lwp) write (numout,'(a,3f15.5)') 'Sediment  N ', & 
     254         &        fq0, fq1, fq2 
     255      fq0 = MINVAL(zn_sed_fe(:,:)) 
     256      fq1 = MAXVAL(zn_sed_fe(:,:)) 
     257      fq2 = SUM(zn_sed_fe(:,:)) 
     258      if (lwp) write (numout,'(a,3f15.5)') 'Sediment Fe ', & 
     259         &        fq0, fq1, fq2 
     260      fq0 = MINVAL(zn_sed_si(:,:)) 
     261      fq1 = MAXVAL(zn_sed_si(:,:)) 
     262      fq2 = SUM(zn_sed_si(:,:)) 
     263      if (lwp) write (numout,'(a,3f15.5)') 'Sediment Si ', & 
     264         &        fq0, fq1, fq2 
     265      fq0 = MINVAL(zn_sed_c(:,:)) 
     266      fq1 = MAXVAL(zn_sed_c(:,:)) 
     267      fq2 = SUM(zn_sed_c(:,:)) 
     268      if (lwp) write (numout,'(a,3f15.5)') 'Sediment  C ', & 
     269         &        fq0, fq1, fq2 
     270      fq0 = MINVAL(zn_sed_ca(:,:)) 
     271      fq1 = MAXVAL(zn_sed_ca(:,:)) 
     272      fq2 = SUM(zn_sed_ca(:,:)) 
     273      if (lwp) write (numout,'(a,3f15.5)') 'Sediment Ca ', & 
     274         &        fq0, fq1, fq2 
     275#endif 
     276 
    144277      ! 
    145278      IF( kt == nitrst ) THEN 
Note: See TracChangeset for help on using the changeset viewer.