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 8642 for branches/NERC/dev_r5518_GO6_Carb_Debug/NEMOGCM/NEMO/TOP_SRC/MEDUSA/air_sea.F90 – NEMO

Ignore:
Timestamp:
2017-10-19T18:10:44+02:00 (7 years ago)
Author:
jpalmier
Message:

jpalm --19-10-17-- Carb failure due to 1-cell exceptionnal and ephemeral T increase - update T passed to MEDUSA and add kill switch

File:
1 edited

Legend:

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

    r8521 r8642  
    6262# endif 
    6363                                   zchd, zchn, zdin, zsil 
    64       USE dom_oce,           ONLY: e3t_0, e3t_n, gphit, tmask 
     64      USE dom_oce,           ONLY: e3t_0, e3t_n, gphit, tmask, mig, mjg 
    6565# if defined key_iomput 
    6666      USE iom,               ONLY: lk_iomput 
     
    9191      USE trcoxy_medusa,     ONLY: trc_oxy_medusa 
    9292# endif 
     93      USE lib_mpp,           ONLY: ctl_stop 
     94      USE trcstat  
    9395 
    9496   !!* Substitution 
     
    122124 
    123125# if defined key_roam 
     126      !! init 
     127      f_fco2w(:,:)       = 0.0 
     128      f_fco2atm(:,:)     = 0.0 
     129      f_schmidtco2(:,:)  = 0.0 
     130      f_kwco2(:,:)       = 0.0 
     131      f_co2starair(:,:)  = 0.0 
     132      f_dpco2(:,:)       = 0.0 
     133      f_rhosw(:,:)       = 0.0 
     134      f_K0(:,:)          = 0.0 
     135      !! air pressure (atm); ultimately this will use air  
     136      !! pressure at the base of the UKESM1 atmosphere  
     137      !!                                      
     138      f_pp0(:,:)   = 1.0 
     139 
     140 
    124141      !!----------------------------------------------------------- 
    125142      !! Air-sea gas exchange 
     
    134151         DO ji = 2,jpim1 
    135152            !! OPEN wet point IF..THEN loop 
    136             if (tmask(ji,jj,1) == 1) then 
     153            IF (tmask(ji,jj,1) == 1) then 
    137154               IF (lk_oasis) THEN 
    138155                  !! use 2D atm xCO2 from atm coupling 
    139156                  f_xco2a(ji,jj) = PCO2a_in_cpl(ji,jj) 
     157                  !!!  
     158                  !!! Jpalm test on atm xCO2 
     159                  IF ( (f_xco2a(ji,jj) > 1000 ).OR.(f_xco2a(ji,jj) < 100 ) ) THEN 
     160                     IF(lwp) WRITE(numout,*) ' atm xCO2 = ',f_xco2a(ji,jj),   & 
     161                                             ' -- ji =', mig(ji),' jj = ', mjg(jj) 
     162                     CALL ctl_stop( 'MEDUSA - Air-Sea :', 'unrealistic atm xCO2 ' ) 
     163                 ENDIF  
    140164               ENDIF 
    141165               !! 
     
    162186               'air-sea: carb-chem kt = ', kt 
    163187               CALL flush(numout) 
     188               !! JPALM add carb print: 
     189               call trc_rst_dia_stat(f_xco2a(:,:), 'f_xco2a') 
     190               call trc_rst_dia_stat(wndm(:,:), 'wndm') 
     191               call trc_rst_dia_stat(f_kw660(:,:), 'f_kw660') 
     192               call trc_rst_dia_stat(ztmp(:,:), 'ztmp') 
     193               call trc_rst_dia_stat(zsal(:,:), 'zsal') 
     194               call trc_rst_dia_stat(zalk(:,:), 'zalk') 
     195               call trc_rst_dia_stat(zdic(:,:), 'zdic') 
     196               call trc_rst_dia_stat(zsil(:,:), 'zsil') 
     197               call trc_rst_dia_stat(zpho(:,:), 'zpho') 
    164198#   endif 
    165199      DO jj = 2,jpjm1 
    166200         DO ji = 2,jpim1 
    167201            if (tmask(ji,jj,1) == 1) then 
    168                !! air pressure (atm); ultimately this will use air  
    169                !! pressure at the base of the UKESM1 atmosphere  
    170                !!                                      
    171                f_pp0(ji,jj)   = 1.0 
    172                !! 
    173                !! IF(lwp) WRITE(numout,*) ' MEDUSA ztmp    =', ztmp(ji,jj) 
    174                !! IF(lwp) WRITE(numout,*) ' MEDUSA wndm    =', wndm(ji,jj) 
    175                !! IF(lwp) WRITE(numout,*) ' MEDUSA fr_i    =', fr_i(ji,jj) 
    176202               !! 
    177203#  if defined key_axy_carbchem 
    178204#   if defined key_mocsy 
     205               !! Jpalm -- 12-09-2017 -- add extra check after reccurent 
     206               !!          carbonate failure in the coupled run. 
     207               !!          must be associated to air-sea flux or air xCO2...i 
     208               !!          Check MOCSY inputs 
     209               IF ( (zsal(ji,jj) > 75.0 ).OR.(zsal(ji,jj) < 0.0 ) .OR.     & 
     210                    (ztmp(ji,jj) > 50.0 ).OR.(ztmp(ji,jj) < -20.0 ) .OR.     & 
     211                    (zalk(ji,jj) > 35.0E2 ).OR.(zalk(ji,jj) <= 0.0 ) .OR.     & 
     212                    (zdic(ji,jj) > 35.0E2 ).OR.(zdic(ji,jj) <= 0.0 ) .OR.     & 
     213                    (f_kw660(ji,jj) > 1.0E-2 ).OR.(f_kw660(ji,jj) < 0.0 ) ) THEN 
     214                  IF(lwp) THEN  
     215                      WRITE(numout,*) ' surface T = ',ztmp(ji,jj) 
     216                      WRITE(numout,*) ' surface S = ',zsal(ji,jj) 
     217                      WRITE(numout,*) ' surface ALK = ',zalk(ji,jj) 
     218                      WRITE(numout,*) ' surface DIC = ',zdic(ji,jj) 
     219                      WRITE(numout,*) ' KW660 = ',f_kw660(ji,jj) 
     220                      WRITE(numout,*) ' atm xCO2 = ',f_xco2a(ji,jj)    
     221                      WRITE(numout,*) ' surface pco2w  = ',f_pco2w(ji,jj) 
     222                      WRITE(numout,*) ' surface fco2w  = ',f_fco2w(ji,jj) 
     223                      WRITE(numout,*) ' surface fco2a  = ',f_fco2atm(ji,jj) 
     224                      WRITE(numout,*) ' surface co2flx = ',f_co2flux(ji,jj) 
     225                      WRITE(numout,*) ' surface dpco2  = ',f_dpco2(ji,jj) 
     226                      WRITE(numout,*) ' MOCSY input: ji =', mig(ji),' jj = ', mjg(jj),  & 
     227                                       ' kt = ', kt  
     228                      WRITE(numout,*) 'MEDUSA - Air-Sea : unrealistic surface Carb. Chemistry' 
     229                      CALL ctl_stop( 'MEDUSA - Air-Sea :', 'unrealistic surface Carb. Chemistry -- INPUTS' ) 
     230                  ENDIF      
     231               ENDIF      
    179232               !! 
    180233               !! AXY (22/06/15): use Orr & Epitalon (2015) MOCSY-2 carbonate 
     
    201254               f_TALK(ji,jj) = (zalk(ji,jj) / f_rhosw(ji,jj)) * 1000. 
    202255               f_dcf(ji,jj)  = f_rhosw(ji,jj) 
     256               !! Jpalm -- 12-09-2017 -- add extra check after reccurent 
     257               !!          carbonate failure in the coupled run. 
     258               !!          must be associated to air-sea flux or air xCO2...i 
     259               !!          Check MOCSY inputs 
     260              IF ( (f_pco2w(ji,jj) > 1.E4 ).OR.(f_pco2w(ji,jj) < 0.0 ) .OR.     & 
     261                   (f_fco2w(ji,jj) > 1.E4 ).OR.(f_fco2w(ji,jj) < 0.0 ) .OR.     &    
     262                   (f_fco2atm(ji,jj) > 1.E4 ).OR.(f_fco2atm(ji,jj) < 0.0 ) .OR.     & 
     263                   (f_co2flux(ji,jj) > 1.E-2 ).OR.(f_co2flux(ji,jj) < -1.E-2 ) .OR.     & 
     264                   (f_dpco2(ji,jj) > 1.E4 ).OR.(f_dpco2(ji,jj) < -1.E4 ) ) THEN 
     265                 IF(lwp) THEN  
     266                     WRITE(numout,*) ' surface T = ',ztmp(ji,jj) 
     267                     WRITE(numout,*) ' surface S = ',zsal(ji,jj) 
     268                     WRITE(numout,*) ' surface ALK = ',zalk(ji,jj) 
     269                     WRITE(numout,*) ' surface DIC = ',zdic(ji,jj) 
     270                     WRITE(numout,*) ' KW660 = ',f_kw660(ji,jj) 
     271                     WRITE(numout,*) ' atm xCO2 = ',f_xco2a(ji,jj)    
     272                     WRITE(numout,*) ' surface pco2w  = ',f_pco2w(ji,jj) 
     273                     WRITE(numout,*) ' surface fco2w  = ',f_fco2w(ji,jj) 
     274                     WRITE(numout,*) ' surface fco2a  = ',f_fco2atm(ji,jj) 
     275                     WRITE(numout,*) ' surface co2flx = ',f_co2flux(ji,jj) 
     276                     WRITE(numout,*) ' surface dpco2  = ',f_dpco2(ji,jj) 
     277                     WRITE(numout,*) ' MOCSY output: ji =', mig(ji),' jj = ', mjg(jj),  & 
     278                                       ' kt = ', kt      
     279                     WRITE(numout,*) 'MEDUSA - Air-Sea : unrealistic surface Carb. Chemistry' 
     280                     CALL ctl_stop( 'MEDUSA - Air-Sea :', 'unrealistic surface Carb. Chemistry -- OUTPUTS' ) 
     281                 ENDIF      
     282              ENDIF      
    203283            ENDIF 
    204284         ENDDO 
    205285      ENDDO 
    206286 
     287#   if defined key_debug_medusa 
     288               !! JPALM add carb print: 
     289               call trc_rst_dia_stat(f_pco2w(:,:), 'f_pco2w') 
     290               call trc_rst_dia_stat(f_fco2w(:,:), 'f_fco2w') 
     291               call trc_rst_dia_stat(f_fco2atm(:,:), 'f_fco2atm') 
     292               call trc_rst_dia_stat(f_schmidtco2(:,:), 'f_schmidtco2') 
     293               call trc_rst_dia_stat(f_kwco2(:,:), 'f_kwco2') 
     294               call trc_rst_dia_stat(f_co2starair(:,:), 'f_co2starair') 
     295               call trc_rst_dia_stat(f_co2flux(:,:), 'f_co2flux') 
     296               call trc_rst_dia_stat(f_dpco2(:,:), 'f_dpco2') 
     297#   endif 
    207298#   else    
    208299 
Note: See TracChangeset for help on using the changeset viewer.