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 9309 for branches/NERC/dev_r5518_GO6_CO2_cmip/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcbio_medusa.F90 – NEMO

Ignore:
Timestamp:
2018-02-06T12:22:05+01:00 (6 years ago)
Author:
jpalmier
Message:

JPALM -- make clearer in the code and output which atm xCO2 source is used

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/NERC/dev_r5518_GO6_CO2_cmip/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcbio_medusa.F90

    r9304 r9309  
    9393                                            mpp_min, mpp_minloc,            & 
    9494                                            ctl_stop, ctl_warn, lk_mpp   
    95       USE oce,                        ONLY: tsb, tsn 
     95      USE oce,                        ONLY: tsb, tsn, PCO2a_in_cpl 
    9696      USE par_kind,                   ONLY: wp 
    9797      USE par_medusa,                 ONLY: jpalk, jpchd, jpchn, jpdet,     & 
     
    103103      !! JPALM (27-06-2016): add lk_oasis for CO2 and DMS coupling with atm 
    104104      USE sbc_oce,                    ONLY: lk_oasis 
    105       USE sms_medusa,                 ONLY: hist_pco2, co2_yinit, co2_yend 
     105      USE sms_medusa,                 ONLY: hist_pco2, co2_yinit, co2_yend, & 
     106                                            lk_pi_co2 
    106107      USE trc,                        ONLY: ln_rsttr, nittrc000, trn 
    107108      USE bio_medusa_init_mod,        ONLY: bio_medusa_init 
     
    295296      !!------------------------------------------------------------------ 
    296297      !! 
    297       !! what's atmospheric pCO2 doing? (data start in 1859) 
    298       !! AXY - JPALM new interpolation scheme usinf nyear_len 
    299       this_y = real(nyear) 
    300       this_d = real(nday_year) 
    301       this_s = real(nsec_day) 
    302       !! 
    303       fyear = this_y + ((this_d - 1) + (this_s / (60. * 60. * 24.))) / real(nyear_len(1)) 
    304       !! 
    305       IF ( ( kt == nittrc000 ) .AND. lwp ) THEN  
    306          WRITE(numout,*) ' MEDUSA year      =', this_y 
    307          WRITE(numout,*) ' Year length      =', real(nyear_len(1)) 
    308          WRITE(numout,*) ' MEDUSA nday_year =', this_d 
    309          WRITE(numout,*) ' MEDUSA nsec_day  =', this_s 
    310       ENDIF 
    311       !!  
    312       !! different case test  
    313       IF (fyear .LE. co2_yinit) THEN 
    314          !! before first record -- pre-industrial value 
    315          f_xco2a(:,:) = hist_pco2(1)   
    316       ELSEIF (fyear .GE. co2_yend) THEN 
    317          !! after last record - continue to use the last value 
    318          f_xco2a(:,:) = hist_pco2(int(co2_yend - co2_yinit + 1.) ) 
    319       ELSE 
    320          !! just right 
    321          iyr1 = int(fyear - co2_yinit) + 1 
    322          iyr2 = iyr1 + 1  
    323          fq3 = fyear - real(iyr1) - co2_yinit + 1. 
    324          fq4 = ((1 - fq3) * hist_pco2(iyr1)) + (fq3 * hist_pco2(iyr2)) 
    325          f_xco2a(:,:) = fq4 
     298      IF (lk_oasis) THEN  
     299         !! xCO2 from coupled 
     300         IF ( ( kt == nittrc000 ) .AND. lwp )     & 
     301             WRITE(numout,*) '** MEDUSA Atm xCO2 given by the UM **' 
     302         f_xco2a(:,:) = PCO2a_in_cpl(:,:) 
     303      ELSEIF (lk_pi_co2) THEN 
     304         !! OCMIP pre-industrial xCO2 
     305         IF ( ( kt == nittrc000 ) .AND. lwp )     & 
     306             WRITE(numout,*) '** MEDUSA Atm xCO2 fixed to pre-industrial value **' 
     307         !! f_xco2a(:,:) = 284.725  !! CMIP5 pre-industrial pCO2 
     308         f_xco2a(:,:) = 284.317          !! CMIP6 pre-industrial pCO2  
     309      ELSE       
     310         !! xCO2 from file 
     311         !! AXY - JPALM new interpolation scheme usinf nyear_len 
     312         this_y = real(nyear) 
     313         this_d = real(nday_year) 
     314         this_s = real(nsec_day) 
     315         !! 
     316         fyear = this_y + ((this_d - 1) + (this_s / (60. * 60. * 24.))) / real(nyear_len(1)) 
    326317         !! 
    327318         IF ( ( kt == nittrc000 ) .AND. lwp ) THEN  
    328             WRITE(numout,*) ' MEDUSA year1     =', iyr1 
    329             WRITE(numout,*) ' MEDUSA year2     =', iyr2 
    330             WRITE(numout,*) ' xCO2 year1       =', hist_pco2(iyr1) 
    331             WRITE(numout,*) ' xCO2 year2       =', hist_pco2(iyr2) 
    332             WRITE(numout,*) ' Year2 weight     =', fq3 
     319            WRITE(numout,*) '** MEDUSA Atm xCO2 from file **' 
     320            WRITE(numout,*) ' MEDUSA year      =', this_y 
     321            WRITE(numout,*) ' Year length      =', real(nyear_len(1)) 
     322            WRITE(numout,*) ' MEDUSA nday_year =', this_d 
     323            WRITE(numout,*) ' MEDUSA nsec_day  =', this_s 
     324         ENDIF 
     325         !!  
     326         !! different case test  
     327         IF (fyear .LE. co2_yinit) THEN 
     328            !! before first record -- pre-industrial value 
     329            f_xco2a(:,:) = hist_pco2(1)   
     330         ELSEIF (fyear .GE. co2_yend) THEN 
     331            !! after last record - continue to use the last value 
     332            f_xco2a(:,:) = hist_pco2(int(co2_yend - co2_yinit + 1.) ) 
     333         ELSE 
     334            !! just right 
     335            iyr1 = int(fyear - co2_yinit) + 1 
     336            iyr2 = iyr1 + 1  
     337            fq3 = fyear - real(iyr1) - co2_yinit + 1. 
     338            fq4 = ((1 - fq3) * hist_pco2(iyr1)) + (fq3 * hist_pco2(iyr2)) 
     339            f_xco2a(:,:) = fq4 
     340            !! 
     341            IF ( ( kt == nittrc000 ) .AND. lwp ) THEN  
     342               WRITE(numout,*) ' MEDUSA year1     =', iyr1 
     343               WRITE(numout,*) ' MEDUSA year2     =', iyr2 
     344               WRITE(numout,*) ' xCO2 year1       =', hist_pco2(iyr1) 
     345               WRITE(numout,*) ' xCO2 year2       =', hist_pco2(iyr2) 
     346               WRITE(numout,*) ' Year2 weight     =', fq3 
     347            ENDIF 
    333348         ENDIF 
    334349      ENDIF 
    335 #  if defined key_axy_pi_co2 
    336       !! OCMIP pre-industrial pCO2 
    337       !! f_xco2a(:,:) = 284.725  !! CMIP5 pre-industrial pCO2 
    338       f_xco2a(:,:) = 284.317          !! CMIP6 pre-industrial pCO2  
    339 #  endif 
    340       !! AXY (29/01/14): remove surplus diagnostics 
    341        IF ( ( kt == nittrc000 ) .AND. lwp )   &  
     350      IF ( ( kt == nittrc000 ) .AND. lwp )   &  
    342351            WRITE(numout,*) ' final atm xCO2   =', f_xco2a(1,1) 
    343352# endif 
Note: See TracChangeset for help on using the changeset viewer.