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 9351 for branches/NERC/dev_r5518_GO6_rev9312_xCO2/NEMOGCM/NEMO – NEMO

Ignore:
Timestamp:
2018-02-23T14:18:47+01:00 (6 years ago)
Author:
jpalmier
Message:

merge this branch with dev_r5518_GO6_CO2_cmip 3270 to 9344

Location:
branches/NERC/dev_r5518_GO6_rev9312_xCO2/NEMOGCM/NEMO/TOP_SRC
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/NERC/dev_r5518_GO6_rev9312_xCO2/NEMOGCM/NEMO/TOP_SRC/MEDUSA/air_sea.F90

    r9257 r9351  
    153153            IF (tmask(ji,jj,1) == 1) then 
    154154               IF (lk_oasis) THEN 
    155                   !! use 2D atm xCO2 from atm coupling 
    156                   f_xco2a(ji,jj) = PCO2a_in_cpl(ji,jj) 
    157                   !!!  
    158155                  !!! Jpalm test on atm xCO2 
    159                   IF ( (f_xco2a(ji,jj) > 1500.0 ).OR.(f_xco2a(ji,jj) < 100.0 ) ) THEN 
     156                  IF ( (f_xco2a(ji,jj) .GT. 10000.0 ).OR.(f_xco2a(ji,jj) .LE. 0.0 ) ) THEN 
    160157                    IF(lwp) THEN  
    161158                       WRITE(numout,*) ' atm xCO2 = ',f_xco2a(ji,jj),          & 
    162159                                       ' -- ji =', mig(ji),' jj = ', mjg(jj) 
    163160                    ENDIF 
    164                     CALL ctl_stop( 'MEDUSA - Air-Sea :', 'unrealistic atm xCO2 ' ) 
     161                    CALL ctl_stop( 'MEDUSA - Air-Sea :', 'unrealistic coupled atm xCO2 ' ) 
    165162                 ENDIF  
    166163               ENDIF 
     
    261258               !!          must be associated to air-sea flux or air xCO2... 
    262259               !!          Check MOCSY outputs 
    263               IF ( (f_pco2w(ji,jj) > 1.E4 ).OR.(f_pco2w(ji,jj) < 0.0 ) .OR.     & 
    264                    (f_fco2w(ji,jj) > 1.E4 ).OR.(f_fco2w(ji,jj) < 0.0 ) .OR.     &    
    265                    (f_fco2atm(ji,jj) > 1.E4 ).OR.(f_fco2atm(ji,jj) < 0.0 ) .OR.     & 
    266                    (f_co2flux(ji,jj) > 1.E-2 ).OR.(f_co2flux(ji,jj) < -1.E-2 ) .OR.     & 
    267                    (f_dpco2(ji,jj) > 1.E4 ).OR.(f_dpco2(ji,jj) < -1.E4 ) ) THEN 
    268                  IF(lwp) THEN  
    269                      WRITE(numout,*) ' surface T = ',ztmp(ji,jj) 
    270                      WRITE(numout,*) ' surface S = ',zsal(ji,jj) 
    271                      WRITE(numout,*) ' surface ALK = ',zalk(ji,jj) 
    272                      WRITE(numout,*) ' surface DIC = ',zdic(ji,jj) 
    273                      WRITE(numout,*) ' KW660 = ',f_kw660(ji,jj) 
    274                      WRITE(numout,*) ' atm xCO2 = ',f_xco2a(ji,jj)    
    275                      WRITE(numout,*) ' surface pco2w  = ',f_pco2w(ji,jj) 
    276                      WRITE(numout,*) ' surface fco2w  = ',f_fco2w(ji,jj) 
    277                      WRITE(numout,*) ' surface fco2a  = ',f_fco2atm(ji,jj) 
    278                      WRITE(numout,*) ' surface co2flx = ',f_co2flux(ji,jj) 
    279                      WRITE(numout,*) ' surface dpco2  = ',f_dpco2(ji,jj) 
    280                      WRITE(numout,*) ' MOCSY output: ji =', mig(ji),' jj = ', mjg(jj),  & 
    281                                        ' kt = ', kt      
    282                      WRITE(numout,*) 'MEDUSA - Air-Sea OUTPUT: unrealistic surface Carb. Chemistry' 
    283                  ENDIF      
    284                  CALL ctl_stop( 'MEDUSA - Air-Sea OUTPUT: ',            & 
    285                                 'unrealistic surface Carb. Chemistry -- OUTPUTS' ) 
    286               ENDIF      
     260               !!=================== 
     261               !! Jpalm -- 19-02-2018 -- remove the cap - only check MOCSY inputs 
     262               !!       because of specific area in arabic sea where strangely 
     263               !!       with core 2 forcing, ALK is lower than DIC and result in  
     264               !!       Enormous dpco2 - even if all carb chem caract are OK. 
     265               !!       and this check stops the model. 
     266               !!       ==> let's run the model without it and see how it goes. 
     267               !!=================== 
     268               !!IF ( (f_pco2w(ji,jj) > 1.E4 ).OR.(f_pco2w(ji,jj) < 0.0 ) .OR.     & 
     269               !!    (f_fco2w(ji,jj) > 1.E4 ).OR.(f_fco2w(ji,jj) < 0.0 ) .OR.     &    
     270               !!    (f_fco2atm(ji,jj) > 1.E4 ).OR.(f_fco2atm(ji,jj) < 0.0 ) .OR.     & 
     271               !!    (f_co2flux(ji,jj) > 1.E-1 ).OR.(f_co2flux(ji,jj) < -1.E-1 ) .OR.     & 
     272               !!    (f_dpco2(ji,jj) > 1.E4 ).OR.(f_dpco2(ji,jj) < -1.E4 ) ) THEN 
     273               !!  IF(lwp) THEN  
     274               !!      WRITE(numout,*) ' surface T = ',ztmp(ji,jj) 
     275               !!      WRITE(numout,*) ' surface S = ',zsal(ji,jj) 
     276               !!      WRITE(numout,*) ' surface ALK = ',zalk(ji,jj) 
     277               !!      WRITE(numout,*) ' surface DIC = ',zdic(ji,jj) 
     278               !!      WRITE(numout,*) ' KW660 = ',f_kw660(ji,jj) 
     279               !!      WRITE(numout,*) ' atm xCO2 = ',f_xco2a(ji,jj)    
     280               !!      WRITE(numout,*) ' surface pco2w  = ',f_pco2w(ji,jj) 
     281               !!      WRITE(numout,*) ' surface fco2w  = ',f_fco2w(ji,jj) 
     282               !!      WRITE(numout,*) ' surface fco2a  = ',f_fco2atm(ji,jj) 
     283               !!      WRITE(numout,*) ' surface co2flx = ',f_co2flux(ji,jj) 
     284               !!      WRITE(numout,*) ' surface dpco2  = ',f_dpco2(ji,jj) 
     285               !!      WRITE(numout,*) ' MOCSY output: ji =', mig(ji),' jj = ', mjg(jj),  & 
     286               !!                        ' kt = ', kt      
     287               !!      WRITE(numout,*) 'MEDUSA - Air-Sea OUTPUT: unrealistic surface Carb. Chemistry' 
     288               !!  ENDIF      
     289               !!  CALL ctl_stop( 'MEDUSA - Air-Sea OUTPUT: ',            & 
     290               !!                 'unrealistic surface Carb. Chemistry -- OUTPUTS' ) 
     291               !!ENDIF      
    287292            ENDIF 
    288293         ENDDO 
  • branches/NERC/dev_r5518_GO6_rev9312_xCO2/NEMOGCM/NEMO/TOP_SRC/MEDUSA/carb_chem.F90

    r8441 r9351  
    103103               !! OPEN wet point IF..THEN loop 
    104104               IF (tmask(ji,jj,jk).eq.1) THEN 
    105                   IF (lk_oasis) THEN 
    106                      !! use 2D atm xCO2 from atm coupling 
    107                      f_xco2a(ji,jj) = PCO2a_in_cpl(ji,jj) 
    108                   ENDIF 
    109105                  !! Do carbonate chemistry 
    110106                  !! 
  • branches/NERC/dev_r5518_GO6_rev9312_xCO2/NEMOGCM/NEMO/TOP_SRC/MEDUSA/sms_medusa.F90

    r9258 r9351  
    283283#if defined key_roam 
    284284!!---------------------------------------------------------------------- 
    285 !! Atmospheric pCO2 data (1859 to 2100 inclusive) 
    286 !!---------------------------------------------------------------------- 
    287 !! 
    288    REAL(wp), DIMENSION(242)         ::   hist_pco2 !: pCO2 
    289  
    290 # if defined key_rcp26 
    291       !! UKMO, run AJKKH + KAAEC, RCP 2.6, pCO2 time evolution 
    292       DATA hist_pco2 / 286.0230, 286.1730, 286.3230, 286.4480, 286.5730, & 
    293       & 286.7230, 286.8480, 286.9480, 287.0480, 287.1730, & 
    294       & 287.3230, 287.4730, 287.6480, 287.8480, 288.0730, & 
    295       & 288.3480, 288.6480, 288.9730, 289.3470, 289.7470, & 
    296       & 290.1730, 290.6470, 291.1470, 291.6220, 292.0720, & 
    297       & 292.5220, 292.9220, 293.2470, 293.5220, 293.7470, & 
    298       & 293.9470, 294.1220, 294.2720, 294.4220, 294.5470, & 
    299       & 294.6470, 294.7470, 294.8470, 294.9710, 295.1710, & 
    300       & 295.4460, 295.7470, 296.0720, 296.4210, 296.7710, & 
    301       & 297.1460, 297.5710, 298.0210, 298.4460, 298.8460, & 
    302       & 299.2460, 299.6450, 300.0210, 300.3710, 300.7200, & 
    303       & 301.0450, 301.3460, 301.6710, 302.0200, 302.3450, & 
    304       & 302.6450, 302.9700, 303.3450, 303.7200, 304.0700, & 
    305       & 304.4700, 304.9200, 305.3440, 305.7700, 306.2450, & 
    306       & 306.7190, 307.1700, 307.6440, 308.1190, 308.5440, & 
    307       & 308.9440, 309.3440, 309.6940, 309.9440, 310.1190, & 
    308       & 310.2440, 310.3190, 310.3190, 310.2440, 310.1440, & 
    309       & 310.0690, 310.0440, 310.0690, 310.1440, 310.2690, & 
    310       & 310.4440, 310.6940, 311.0430, 311.4440, 311.8690, & 
    311       & 312.3680, 312.9430, 313.5430, 314.1680, 314.7900, & 
    312       & 315.4430, 316.2150, 317.0170, 317.7370, 318.3400, & 
    313       & 318.8680, 319.5900, 320.5890, 321.5470, 322.5770, & 
    314       & 323.8440, 324.9260, 325.7960, 327.0810, 328.6180, & 
    315       & 329.6830, 330.5250, 331.6880, 333.2120, 334.7870, & 
    316       & 336.4640, 338.2990, 339.6660, 340.7310, 342.1360, & 
    317       & 343.7200, 345.2200, 346.7350, 348.5820, 350.6740, & 
    318       & 352.4230, 353.7910, 354.9530, 355.8210, 356.7130, & 
    319       & 358.0630, 359.7720, 361.3970, 363.0900, 365.2560, & 
    320       & 367.2810, 368.7980, 370.4000, 372.4550, 374.6920, & 
    321       & 376.7440, 378.7440, 380.7580, 382.7080, 384.7300, & 
    322       & 386.9310, 389.2150, 391.4910, 393.7710, 396.0460, & 
    323       & 398.3240, 400.6080, 402.8950, 405.1780, 407.4550, & 
    324       & 409.7260, 411.9930, 414.2500, 416.4410, 418.5280, & 
    325       & 420.5250, 422.4390, 424.2720, 426.0200, 427.6750, & 
    326       & 429.2360, 430.7050, 432.0850, 433.3580, 434.5140, & 
    327       & 435.5740, 436.5490, 437.4420, 438.2550, 438.9810, & 
    328       & 439.6110, 440.1430, 440.5770, 440.9450, 441.2660, & 
    329       & 441.5410, 441.7840, 442.0050, 442.2040, 442.3780, & 
    330       & 442.5210, 442.6200, 442.6720, 442.6810, 442.6540, & 
    331       & 442.5830, 442.4670, 442.3270, 442.1680, 441.9960, & 
    332       & 441.8060, 441.5930, 441.3440, 441.0540, 440.7230, & 
    333       & 440.3510, 439.9300, 439.4650, 438.9730, 438.4630, & 
    334       & 437.9400, 437.4020, 436.8400, 436.2640, 435.6850, & 
    335       & 435.1030, 434.5160, 433.9170, 433.3060, 432.7010, & 
    336       & 432.1110, 431.5380, 430.9810, 430.4320, 429.8860, & 
    337       & 429.3370, 428.7810, 428.2220, 427.6490, 427.0660, & 
    338       & 426.4890, 425.9270, 425.3840, 424.8610, 424.3540, & 
    339       & 423.8540, 423.3540, 422.8530, 422.3510, 421.8410, & 
    340       & 421.3250, 420.8190 / 
    341 # else 
    342       !! UKMO, run AJKKH + KAAEF, RCP 8.5, pCO2 time evolution 
    343       DATA hist_pco2 / 286.0230, 286.1730, 286.3230, 286.4480, 286.5730, & 
    344       & 286.7230, 286.8480, 286.9480, 287.0480, 287.1730, & 
    345       & 287.3230, 287.4730, 287.6480, 287.8480, 288.0730, & 
    346       & 288.3480, 288.6480, 288.9730, 289.3470, 289.7470, & 
    347       & 290.1730, 290.6470, 291.1470, 291.6220, 292.0720, & 
    348       & 292.5220, 292.9220, 293.2470, 293.5220, 293.7470, & 
    349       & 293.9470, 294.1220, 294.2720, 294.4220, 294.5470, & 
    350       & 294.6470, 294.7470, 294.8470, 294.9710, 295.1710, & 
    351       & 295.4460, 295.7470, 296.0720, 296.4210, 296.7710, & 
    352       & 297.1460, 297.5710, 298.0210, 298.4460, 298.8460, & 
    353       & 299.2460, 299.6450, 300.0210, 300.3710, 300.7200, & 
    354       & 301.0450, 301.3460, 301.6710, 302.0200, 302.3450, & 
    355       & 302.6450, 302.9700, 303.3450, 303.7200, 304.0700, & 
    356       & 304.4700, 304.9200, 305.3440, 305.7700, 306.2450, & 
    357       & 306.7190, 307.1700, 307.6440, 308.1190, 308.5440, & 
    358       & 308.9440, 309.3440, 309.6940, 309.9440, 310.1190, & 
    359       & 310.2440, 310.3190, 310.3190, 310.2440, 310.1440, & 
    360       & 310.0690, 310.0440, 310.0690, 310.1440, 310.2690, & 
    361       & 310.4440, 310.6940, 311.0430, 311.4440, 311.8690, & 
    362       & 312.3680, 312.9430, 313.5430, 314.1680, 314.7900, & 
    363       & 315.4430, 316.2150, 317.0170, 317.7370, 318.3400, & 
    364       & 318.8680, 319.5900, 320.5890, 321.5470, 322.5770, & 
    365       & 323.8440, 324.9260, 325.7960, 327.0810, 328.6180, & 
    366       & 329.6830, 330.5250, 331.6880, 333.2120, 334.7870, & 
    367       & 336.4640, 338.2990, 339.6660, 340.7310, 342.1360, & 
    368       & 343.7200, 345.2200, 346.7350, 348.5820, 350.6740, & 
    369       & 352.4230, 353.7910, 354.9530, 355.8210, 356.7130, & 
    370       & 358.0630, 359.7720, 361.3970, 363.0900, 365.2560, & 
    371       & 367.2810, 368.7980, 370.4000, 372.4550, 374.6920, & 
    372       & 376.7440, 378.7440, 380.7580, 382.7080, 384.7300, & 
    373       & 386.9420, 389.2540, 391.5670, 393.9370, 396.3920, & 
    374       & 398.9320, 401.5550, 404.2550, 407.0220, 409.8530, & 
    375       & 412.7470, 415.7050, 418.7210, 421.7880, 424.9180, & 
    376       & 428.1200, 431.3970, 434.7470, 438.1650, 441.6410, & 
    377       & 445.1700, 448.7530, 452.3920, 456.0950, 459.8810, & 
    378       & 463.7680, 467.7660, 471.8750, 476.0960, 480.4210, & 
    379       & 484.8390, 489.3470, 493.9430, 498.6400, 503.4380, & 
    380       & 508.3410, 513.3630, 518.5160, 523.8050, 529.2290, & 
    381       & 534.7780, 540.4450, 546.2230, 552.1120, 558.1110, & 
    382       & 564.2110, 570.4130, 576.7390, 583.1990, 589.7980, & 
    383       & 596.5390, 603.4110, 610.4060, 617.4940, 624.6500, & 
    384       & 631.8800, 639.1750, 646.5360, 653.9800, 661.5230, & 
    385       & 669.1840, 676.9570, 684.8290, 692.7790, 700.7690, & 
    386       & 708.8050, 716.8870, 725.0020, 733.1770, 741.3900, & 
    387       & 749.6700, 758.0480, 766.5050, 775.0350, 783.6110, & 
    388       & 792.2200, 800.8740, 809.5680, 818.2760, 827.0090, & 
    389       & 835.8020, 844.6550, 853.5730, 862.5690, 871.6190, & 
    390       & 880.7020, 889.8240, 898.9590, 908.1270, 917.3080, & 
    391       & 926.4960, 935.7040 / 
    392 # endif 
     285!! JPALM -- change hist_pco2 init 
     286!!---------------------------------------------------------------------- 
     287!! 
     288   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:)   ::   hist_pco2 !: pCO2 
     289   INTEGER  :: co2_rec 
     290   REAL(wp) :: co2_yinit, co2_yend 
     291#endif 
     292 
     293!!---------------------------------------------------------------------- 
     294!! JPALM -- PI CO2 key 
     295!!---------------------------------------------------------------------- 
     296!! 
     297#if defined key_axy_pi_co2 
     298   LOGICAL , PUBLIC ::   lk_pi_co2 = .TRUE.  !: PI xCO2 used 
     299#else 
     300   LOGICAL , PUBLIC ::   lk_pi_co2 = .FALSE. !: PI xCO2 unused 
    393301#endif 
    394302 
  • branches/NERC/dev_r5518_GO6_rev9312_xCO2/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcbio_medusa.F90

    r9257 r9351  
    8181                                            gdept_0, gdept_n,               & 
    8282                                            gdepw_0, gdepw_n,               & 
    83                                             nday_year, nsec_day, nyear,     & 
     83                                            nday_year, nsec_day,            & 
     84                                            nyear, nyear_len, ndastp,       & 
     85                                            nsec_month,                     & 
    8486                                            rdt, tmask, mig, mjg, nimpp,    & 
    8587                                            njmpp  
     
    9294                                            mpp_min, mpp_minloc,            & 
    9395                                            ctl_stop, ctl_warn, lk_mpp   
    94       USE oce,                        ONLY: tsb, tsn 
     96      USE oce,                        ONLY: tsb, tsn, PCO2a_in_cpl 
    9597      USE par_kind,                   ONLY: wp 
    9698      USE par_medusa,                 ONLY: jpalk, jpchd, jpchn, jpdet,     & 
     
    102104      !! JPALM (27-06-2016): add lk_oasis for CO2 and DMS coupling with atm 
    103105      USE sbc_oce,                    ONLY: lk_oasis 
    104       USE sms_medusa,                 ONLY: hist_pco2 
     106      USE sms_medusa,                 ONLY: hist_pco2, co2_yinit, co2_yend, & 
     107                                            lk_pi_co2 
    105108      USE trc,                        ONLY: ln_rsttr, nittrc000, trn 
    106109      USE bio_medusa_init_mod,        ONLY: bio_medusa_init 
     
    114117      USE bio_medusa_diag_slice_mod,  ONLY: bio_medusa_diag_slice 
    115118      USE bio_medusa_fin_mod,         ONLY: bio_medusa_fin 
     119      USE trcstat,                    ONLY: trc_rst_dia_stat 
    116120 
    117121      IMPLICIT NONE 
     
    181185      !!  
    182186      !! temporary variables 
    183       REAL(wp) ::    fq0,fq1,fq2,fq3,fq4 
     187      REAL(wp) ::    fq3,fq4 
     188      REAL(wp) ::    this_y, this_d, this_s, fyear 
    184189      !! 
    185190      !! T and S check temporary variable 
     
    293298      !!------------------------------------------------------------------ 
    294299      !! 
    295       !! what's atmospheric pCO2 doing? (data start in 1859) 
    296       iyr1  = nyear - 1859 + 1 
    297       iyr2  = iyr1 + 1 
    298       if (iyr1 .le. 1) then 
    299          !! before 1860 
    300          f_xco2a(:,:) = hist_pco2(1) 
    301       elseif (iyr2 .ge. 242) then 
    302          !! after 2099 
    303          f_xco2a(:,:) = hist_pco2(242) 
    304       else 
    305          !! just right 
    306          fq0 = hist_pco2(iyr1) 
    307          fq1 = hist_pco2(iyr2) 
    308          fq2 = real(nsec_day) / (60.0 * 60.0 * 24.0) 
    309          !! AXY (14/06/12): tweaked to make more sense (and be correct) 
    310 #  if defined key_bs_axy_yrlen 
    311          !! bugfix: for 360d year with HadGEM2-ES forcing 
    312          fq3 = (real(nday_year) - 1.0 + fq2) / 360.0   
    313 #  else 
    314          !! original use of 365 days (not accounting for leap year or  
    315          !! 360d year) 
    316          fq3 = (real(nday_year) - 1.0 + fq2) / 365.0 
    317 #  endif 
    318          fq4 = (fq0 * (1.0 - fq3)) + (fq1 * fq3) 
    319          f_xco2a(:,:) = fq4 
    320       endif 
    321 #  if defined key_axy_pi_co2 
    322       !! OCMIP pre-industrial pCO2 
    323       !! f_xco2a(:,:) = 284.725  !! CMIP5 pre-industrial pCO2 
    324       f_xco2a = 284.317          !! CMIP6 pre-industrial pCO2  
    325 #  endif 
    326       !! IF(lwp) WRITE(numout,*) ' MEDUSA nyear     =', nyear 
    327       !! IF(lwp) WRITE(numout,*) ' MEDUSA nsec_day  =', real(nsec_day) 
    328       !! IF(lwp) WRITE(numout,*) ' MEDUSA nday_year =', real(nday_year) 
    329       !! AXY (29/01/14): remove surplus diagnostics 
    330       !! IF(lwp) WRITE(numout,*) ' MEDUSA fq0       =', fq0 
    331       !! IF(lwp) WRITE(numout,*) ' MEDUSA fq1       =', fq1 
    332       !! IF(lwp) WRITE(numout,*) ' MEDUSA fq2       =', fq2 
    333       !! IF(lwp) WRITE(numout,*) ' MEDUSA fq3       =', fq3 
    334       IF(lwp) WRITE(numout,*) ' MEDUSA atm pCO2  =', f_xco2a(1,1) 
     300      IF (lk_oasis) THEN  
     301         !! xCO2 from coupled 
     302         IF ( ( kt == nittrc000 ) .AND. lwp )     & 
     303             WRITE(numout,*) '** MEDUSA Atm xCO2 given by the UM **' 
     304         f_xco2a(:,:) = PCO2a_in_cpl(:,:) 
     305      ELSEIF (lk_pi_co2) THEN 
     306         !! OCMIP pre-industrial xCO2 
     307         IF ( ( kt == nittrc000 ) .AND. lwp )     & 
     308             WRITE(numout,*) '** MEDUSA Atm xCO2 fixed to pre-industrial value **' 
     309         !! f_xco2a(:,:) = 284.725       !! CMIP5 pre-industrial pCO2 
     310         f_xco2a(:,:) = 284.317          !! CMIP6 pre-industrial pCO2  
     311      ELSE       
     312         !! xCO2 from file 
     313         !! AXY - JPALM new interpolation scheme usinf nyear_len 
     314         this_y = real(nyear) 
     315         this_d = real(nday_year) 
     316         this_s = real(nsec_day) 
     317         !! 
     318         fyear = this_y + ((this_d - 1) + (this_s / (60. * 60. * 24.))) / real(nyear_len(1)) 
     319         !! 
     320         IF ( ( kt == nittrc000 ) .AND. lwp ) THEN  
     321            WRITE(numout,*) '** MEDUSA Atm xCO2 from file **' 
     322            WRITE(numout,*) ' MEDUSA year      =', this_y 
     323            WRITE(numout,*) ' Year length      =', real(nyear_len(1)) 
     324            WRITE(numout,*) ' MEDUSA nday_year =', this_d 
     325            WRITE(numout,*) ' MEDUSA nsec_day  =', this_s 
     326         ENDIF 
     327         !!  
     328         !! different case test  
     329         IF (fyear .LE. co2_yinit) THEN 
     330            !! before first record -- pre-industrial value 
     331            f_xco2a(:,:) = hist_pco2(1)   
     332         ELSEIF (fyear .GE. co2_yend) THEN 
     333            !! after last record - continue to use the last value 
     334            f_xco2a(:,:) = hist_pco2(int(co2_yend - co2_yinit + 1.) ) 
     335         ELSE 
     336            !! just right 
     337            iyr1 = int(fyear - co2_yinit) + 1 
     338            iyr2 = iyr1 + 1  
     339            fq3 = fyear - real(iyr1) - co2_yinit + 1. 
     340            fq4 = ((1 - fq3) * hist_pco2(iyr1)) + (fq3 * hist_pco2(iyr2)) 
     341            f_xco2a(:,:) = fq4 
     342            !! 
     343            IF ( ( kt == nittrc000 ) .AND. lwp ) THEN  
     344               WRITE(numout,*) ' MEDUSA year1     =', iyr1 
     345               WRITE(numout,*) ' MEDUSA year2     =', iyr2 
     346               WRITE(numout,*) ' xCO2 year1       =', hist_pco2(iyr1) 
     347               WRITE(numout,*) ' xCO2 year2       =', hist_pco2(iyr2) 
     348               WRITE(numout,*) ' Year2 weight     =', fq3 
     349            ENDIF 
     350         ENDIF 
     351      ENDIF 
     352  
     353      !! Writing xCO2 in output on start and on the 1st tsp of each  month 
     354      IF ( (kt == nittrc000 .AND. .NOT.ln_rsttr) .OR.                        & 
     355           ( nsec_month .LE. INT(rdt) ) )  THEN 
     356           IF ( lwp )  WRITE(numout,*) ' *** Atm xCO2 *** -- kt:', kt,       & 
     357                                       ';  current date:', ndastp 
     358          call trc_rst_dia_stat(f_xco2a(:,:), 'atm xCO2') 
     359      ENDIF 
    335360# endif 
    336361 
     
    358383      !!          x * 30d + 1*rdt(i.e: mod = rdt)    
    359384      !!          ++ need to pass carb-chem output var through restarts 
    360       If ( (kt == nittrc000 .AND. .NOT.ln_rsttr) .OR.                        & 
    361            ((86400*mod(nn_date0,100) + mod(kt*rdt,2592000.)) == rdt) ) THEN 
     385      !!If ( (kt == nitt8rc000 .AND. .NOT.ln_rsttr) .OR.          & 
     386      !!     ( (mod(kt*rdt,2592000.)) == rdt) THEN 
     387      !!============================= 
     388      !! (Jpalm -- updated for restartability issues) 
     389      !! We want this to be start of month or if starting afresh from   
     390      !! climatology - marc 20/6/17  
     391      !!If ( (kt == nittrc000 .AND. .NOT.ln_rsttr) .OR.                         &  
     392      !!     ((86400*mod(nn_date0,100) + mod(kt*rdt,2592000.)) == rdt) ) THEN  
     393      !!============================= 
     394      !! Jpalm -- 15-02-2018 -- need to change 3D carb-chem call freq again. 
     395      !! previous call did not work, probably the (86400*mod(nn_date0,100) part 
     396      !! should not be in... 
     397      !! now use the NEMO calendar tool : nsec_month to be sure to call  
     398      !! at the beginning of a new month . 
     399      IF ( (kt == nittrc000 .AND. .NOT.ln_rsttr) .OR.                        & 
     400           ( nsec_month .LE. INT(rdt) ) )  THEN 
     401           IF ( lwp )  WRITE(numout,*)                                       &          
     402                              ' *** 3D carb chem call *** -- kt:', kt,       & 
     403                              ';  current date:', ndastp  
    362404         !!--------------------------------------------------------------- 
    363405         !! Calculate the carbonate chemistry for the whole ocean on the first 
     
    502544         !!              Exceptionnal value did exist 
    503545         !! 
    504          Call trc_bio_check(kt) 
     546         Call trc_bio_check(kt, jk) 
    505547 
    506548         !!================================================================ 
     
    810852   END SUBROUTINE trc_bio_exceptionnal_fix  
    811853 
    812    SUBROUTINE trc_bio_check(kt) 
     854   SUBROUTINE trc_bio_check(kt, jk) 
    813855      !!----------------------------------- 
    814856      !! JPALM -- 14-12-2017 -- Still dealing with this micro-boil/carb failure 
     
    824866      INTEGER               :: ii,ij         ! temporary scalars  
    825867      INTEGER, DIMENSION(2) :: ilocs         !  
    826       INTEGER, INTENT( in ) :: kt 
     868      INTEGER, INTENT( in ) :: kt, jk 
    827869      !! 
    828870      !!========================== 
     
    852894         IF(lwp) THEN 
    853895            WRITE(numout,*) 'trc_bio:tracer anomaly: *****    WARNING     *****' 
    854             WRITE(numout,*) 'trc_bio:tracer anomaly: sea surface DIC > 4000 ' 
    855             WRITE(numout,9600) kt, zmax, ii, ij 
     896            WRITE(numout,*) 'trc_bio:tracer anomaly: DIC concentration > 4000 ' 
     897            WRITE(numout,9600) kt, zmax, ii, ij, jk 
    856898            WRITE(numout,*) 'trc_bio:tracer anomaly: ***** END OF WARNING *****' 
    857899         ENDIF 
     
    869911         IF(lwp) THEN 
    870912            WRITE(numout,*) 'trc_bio:tracer anomaly: *****    WARNING     *****' 
    871             WRITE(numout,*) 'trc_bio:tracer anomaly: sea surface DIC <= 0 ' 
    872             WRITE(numout,9700) kt, zmin, ii, ij 
     913            WRITE(numout,*) 'trc_bio:tracer anomaly: DIC concentration <= 0 ' 
     914            WRITE(numout,9700) kt, zmin, ii, ij, jk 
    873915            WRITE(numout,*) 'trc_bio:tracer anomaly: ***** END OF WARNING *****' 
    874916         ENDIF 
     
    901943         IF(lwp) THEN 
    902944            WRITE(numout,*) 'trc_bio:tracer anomaly: *****     WARNING    *****' 
    903             WRITE(numout,*) 'trc_bio:tracer anomaly: sea surface Alkalinity > 4000 ' 
    904             WRITE(numout,9800) kt, zmax, ii, ij 
     945            WRITE(numout,*) 'trc_bio:tracer anomaly: ALK concentration > 4000 ' 
     946            WRITE(numout,9800) kt, zmax, ii, ij, jk 
    905947            WRITE(numout,*) 'trc_bio:tracer anomaly: ***** END OF WARNING *****' 
    906948         ENDIF 
     
    918960         IF(lwp) THEN 
    919961            WRITE(numout,*) 'trc_bio:tracer anomaly: *****    WARNING     *****' 
    920             WRITE(numout,*) 'trc_bio:tracer anomaly:  sea surface Alkalinity <= 0 ' 
    921             WRITE(numout,9900) kt, zmin, ii, ij 
     962            WRITE(numout,*) 'trc_bio:tracer anomaly:  ALK concentration <= 0 ' 
     963            WRITE(numout,9900) kt, zmin, ii, ij, jk 
    922964            WRITE(numout,*) 'trc_bio:tracer anomaly: ***** END OF WARNING *****' 
    923965         ENDIF 
     
    925967 
    926968 
    927 9600  FORMAT ('trc_bio:tracer anomaly: kt=',i6,' max DIC: ',f16.10,', i j: ',2i5) 
    928 9700  FORMAT ('trc_bio:tracer anomaly: kt=',i6,' min DIC: ',f16.10,', i j: ',2i5) 
    929 9800  FORMAT ('trc_bio:tracer anomaly: kt=',i6,' max ALK: ',f16.10,', i j: ',2i5) 
    930 9900  FORMAT ('trc_bio:tracer anomaly: kt=',i6,' min ALK: ',f16.10,', i j: ',2i5) 
     9699600  FORMAT ('trc_bio:tracer anomaly: kt=',i6,' max DIC: ',f16.10,', i j k: ',3i5) 
     9709700  FORMAT ('trc_bio:tracer anomaly: kt=',i6,' min DIC: ',f16.10,', i j k: ',3i5) 
     9719800  FORMAT ('trc_bio:tracer anomaly: kt=',i6,' max ALK: ',f16.10,', i j k: ',3i5) 
     9729900  FORMAT ('trc_bio:tracer anomaly: kt=',i6,' min ALK: ',f16.10,', i j k: ',3i5) 
    931973 
    932974   END SUBROUTINE trc_bio_check 
  • branches/NERC/dev_r5518_GO6_rev9312_xCO2/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcini_medusa.F90

    r9114 r9351  
    324324      IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~' 
    325325      IF(lwp) CALL flush(numout) 
     326      !! 
     327      !!---------------------------------------------------------------------- 
     328      !! JPALM (23-01-2017): new way to initialize CO2-atm for cmip6  
     329      !!                     initially done in trcsms_medusa 
     330      !!---------------------------------------------------------------------- 
     331      !!  
     332      IF( ( .NOT.lk_oasis ) .AND. ( .NOT.lk_pi_co2 ) ) THEN 
     333         IF(lwp) WRITE(numout,*) ' trc_ini_medusa: initialisating atm CO2 record' 
     334         CALL trc_ini_medusa_co2atm 
     335      ENDIF 
    326336 
    327337   END SUBROUTINE trc_ini_medusa 
     
    480490   END SUBROUTINE trc_ini_medusa_river 
    481491    
     492   SUBROUTINE trc_ini_medusa_co2atm 
     493      !!---------------------------------------------------------------------- 
     494      !!                     ***  trc_ini_medusa_co2atm  ***   
     495      !! 
     496      !! ** Purpose :   initialization atmospheric co2 record 
     497      !! 
     498      !! ** Method  : - Read the xco2 file 
     499      !!---------------------------------------------------------------------- 
     500      INTEGER  ::  jn, jm, io, ierr, inum 
     501      INTEGER  ::  iskip = 4   ! number of 1st descriptor lines 
     502      REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:)   ::   zyy !: xCO2 record years 
     503      CHARACTER (len=10) ::   clname = 'xco2.atm'  !! atm CO2 record file 
     504      !!---------------------------------------------------------------------- 
     505 
     506      IF(lwp) WRITE(numout,*) 
     507      IF(lwp) WRITE(numout,*) ' trc_ini_medusa_co2atm: initialisation of atm CO2 historical record' 
     508      IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~' 
     509 
     510 
     511      IF(lwp) WRITE(numout,*) 'read of formatted file xco2.atm' 
     512 
     513      CALL ctl_opn( inum, clname, 'OLD', 'FORMATTED', 'SEQUENTIAL', -1, numout, .FALSE. ) 
     514      REWIND(inum) 
     515 
     516      ! compute the number of year in the file 
     517      ! file starts in 1849 do jn represent the record number in the file. 
     518      ! the year is jn + yinit - 1 
     519      jn = 1 
     520      DO 
     521        READ(inum,'(1x)',END=100) 
     522        jn = jn + 1 
     523      END DO 
     524 100  co2_rec = jn - 1 - iskip 
     525      IF ( lwp) WRITE(numout,*) '    ', co2_rec ,' years read in the file' 
     526      !                                ! Allocate CO2 hist arrays 
     527      ierr = 0  
     528      ALLOCATE( hist_pco2(co2_rec),zyy(co2_rec), STAT=ierr ) 
     529      IF( ierr > 0 ) THEN 
     530         CALL ctl_stop( 'trc_ini_medusa_co2atm: unable to allocate  array' )   ; RETURN 
     531      ENDIF 
     532 
     533      REWIND(inum) 
     534 
     535      DO jm = 1, iskip        ! Skip over 1st six descriptor lines 
     536         READ(inum,'(1x)') 
     537      END DO 
     538      ! file starts in 1931 do jn represent the year in the century.jhh 
     539      ! Read file till the end 
     540      ! allocate start and end year of the file 
     541      jn = 1 
     542      DO 
     543        READ(inum,*, IOSTAT=io) zyy(jn), hist_pco2(jn) 
     544        IF( io < 0 ) exit 
     545        IF(jn==1) co2_yinit = zyy(jn) 
     546        jn = jn + 1 
     547      END DO 
     548      co2_yend = co2_yinit + real(co2_rec) - 1. 
     549 
     550      IF(lwp) THEN        ! Control print 
     551         WRITE(numout,*) 
     552         WRITE(numout,*) 'CO2 hist start year: ', co2_yinit 
     553         WRITE(numout,*) 'CO2 hist end   year: ', co2_yend 
     554         WRITE(numout,*) ' Year   xCO2 atm ' 
     555         DO jn = 1, co2_rec 
     556            WRITE(numout, '( 5F7.1, 6F9.2)') zyy(jn), hist_pco2(jn) 
     557         END DO 
     558      ENDIF 
     559 
     560   END SUBROUTINE trc_ini_medusa_co2atm 
     561 
     562 
    482563#else 
    483564   !!---------------------------------------------------------------------- 
  • branches/NERC/dev_r5518_GO6_rev9312_xCO2/NEMOGCM/NEMO/TOP_SRC/trcrst.F90

    r9262 r9351  
    378378            !! 
    379379            IF(lwp) WRITE(numout,*) ' CFC averaged properties absent - setting to zero ...' 
    380             qint_cfc(:,:,jn)  = 0.0   !! CHN 
     380            qint_cfc(:,:,jl)  = 0.0   !! CHN 
    381381         ENDIF 
    382382         !! 
Note: See TracChangeset for help on using the changeset viewer.