Changeset 5203 for LMDZ6/branches/cirrus/libf/phylmd
- Timestamp:
- Sep 20, 2024, 1:10:18 PM (5 months ago)
- Location:
- LMDZ6/branches/cirrus
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/cirrus
- Property svn:mergeinfo changed
/LMDZ6/trunk merged: 5181,5183-5184,5188-5191,5196-5201
- Property svn:mergeinfo changed
-
LMDZ6/branches/cirrus/libf/phylmd/infotrac_phy.F90
r5202 r5203 7 7 delPhase, niso, getKey, isot_type, processIsotopes, isotope, maxTableWidth, iqIsoPha, nphas, ixIso, isoPhas, & 8 8 addPhase, iH2O, addKey, isoSelect, testTracersFiles, isoKeys, indexUpdate, iqWIsoPha, nbIso, ntiso, isoName, isoCheck 9 USE readTracFiles_mod, ONLY: new2oldH2O 9 10 IMPLICIT NONE 10 11 … … 16 17 PUBLIC :: nqtot, nbtr, nqo, nqCO2, nqtottr !--- Main dimensions 17 18 PUBLIC :: conv_flg, pbl_flg !--- Convection & boundary layer activation keys 18 #ifdef CPP_StratAer 19 PUBLIC :: new2oldH2O !--- For backwards compatibility in phyetat0 20 PUBLIC :: addPhase, delPhase !--- Add/remove the phase from the name of a tracer 21 #if defined CPP_StratAer || defined REPROBUS 19 22 PUBLIC :: nbtr_bin, nbtr_sulgas !--- Number of aerosols bins and sulfur gases for StratAer model 20 23 PUBLIC :: id_OCS_strat, id_SO2_strat, id_H2SO4_strat, id_BIN01_strat, id_TEST_strat 21 24 #endif 22 25 23 !=== FOR WATER24 PUBLIC :: ivap, iliq, isol25 26 !=== FOR ISOTOPES: General 26 27 PUBLIC :: isot_type, nbIso !--- Derived type, full isotopes families database + nb of families 27 28 PUBLIC :: isoSelect, ixIso !--- Isotopes family selection tool + selected family index 28 29 !=== FOR ISOTOPES: Specific to water 29 PUBLIC :: iH2O !--- H2O isotopes class index 30 PUBLIC :: iH2O !--- Value of "ixIso" for "H2O" isotopes class 31 PUBLIC :: ivap, iliq, isol 30 32 !=== FOR ISOTOPES: Depending on the selected isotopes family 31 PUBLIC :: isotope, isoKeys !--- Selected isotopes database + associated keys (cf. getKey) 32 PUBLIC :: isoName, isoZone, isoPhas !--- Isotopes and tagging zones names, phases 33 PUBLIC :: niso, nzone, nphas, ntiso !--- " " numbers + isotopes & tagging tracers number 34 PUBLIC :: itZonIso !--- idx "it" (in "isoName(1:niso)") = function(tagging idx, isotope idx) 35 PUBLIC :: iqIsoPha !--- idx "iq" (in "qx") = function(isotope idx, phase idx) + aliases 36 PUBLIC :: iqWIsoPha !--- Same as iqIsoPha but with normal water phases 37 33 PUBLIC :: isotope !--- Selected isotopes database (argument of getKey) 34 PUBLIC :: isoKeys, isoName, isoZone, isoPhas !--- Isotopes keys & names, tagging zones names, phases 35 PUBLIC :: niso, ntiso, nzone, nphas !--- Number of " " 36 PUBLIC :: itZonIso !--- Index "it" in "isoName(1:niso)" = f(tagging idx, isotope idx) 37 PUBLIC :: iqIsoPha !--- Index "iq" in "qx" = f(isotope idx, phase idx) 38 PUBLIC :: iqWIsoPha !--- Same as iqIsoPha but with normal water phases 38 39 PUBLIC :: isoCheck !--- Run isotopes checking routines 39 40 !=== FOR BOTH TRACERS AND ISOTOPES … … 43 44 ! |--------------------+-----------------------+-----------------+---------------+----------------------------| 44 45 ! | water in different | water tagging | water isotopes | other tracers | additional tracers moments | 45 ! | phases: H2O_[gls ]| isotopes | | | for higher order schemes |46 ! | phases: H2O_[glsrb]| isotopes | | | for higher order schemes | 46 47 ! |--------------------+-----------------------+-----------------+---------------+----------------------------| 47 48 ! | | | | | | … … 68 69 ! |-------------+------------------------------------------------------+-------------+------------------------+ 69 70 ! | name | Name (short) | tname | | 71 ! | keys | key/val pairs accessible with "getKey" routine | / | | 70 72 ! | gen0Name | Name of the 1st generation ancestor | / | | 71 73 ! | parent | Name of the parent | / | | 72 74 ! | longName | Long name (with adv. scheme suffix) for outputs | ttext | | 73 75 ! | type | Type (so far: tracer or tag) | / | tracer,tag | 74 ! | phase | Phases list ("g"as / "l"iquid / "s"olid) | / | [g][l][s] | 76 ! | phase | Phases list ("g"as / "l"iquid / "s"olid | | [g|l|s|r|b] | 77 ! | | "r"(cloud) / "b"lowing) | / | | 75 78 ! | component | Name(s) of the merged/cumulated section(s) | / | coma-separated names | 76 79 ! | iGeneration | Generation (>=1) | / | | … … 79 82 ! | nqDescen | Number of the descendants (all generations) | nqdesc | 1:nqtot | 80 83 ! | nqChildren | Number of childs (1st generation only) | nqfils | 1:nqtot | 81 ! | keys | key/val pairs accessible with "getKey" routine | / | | 82 ! | isAdvected | advected tracers flag (.TRUE. if iadv >= 0) | / | nqtrue .TRUE. values | 83 ! | isInPhysics | tracers not extracted from the main table in physics | / | nqtottr .TRUE. values | 84 ! | isAdvected | Advected tracers flag (.TRUE. if iadv >= 0) | / | nqtrue .TRUE. values | 85 ! | isInPhysics | Tracers not extracted from the main table in physics | / | nqtottr .TRUE. values | 84 86 ! | iso_iGroup | Isotopes group index in isotopes(:) | / | 1:nbIso | 85 87 ! | iso_iName | Isotope name index in isotopes(iso_iGroup)%trac(:) | iso_indnum | 1:niso | … … 97 99 ! | trac | ntiso | Isotopes + tagging tracers list + number | / | ntraciso | | 98 100 ! | zone | nzone | Geographic tagging zones list + number | / | ntraceurs_zone | | 99 ! | phase | nphas | Phases list + number | | [g ][l][s], 1:3|101 ! | phase | nphas | Phases list + number | | [g|l|s|r|b] 1:5 | 100 102 ! | iqIsoPha | Index in "qx" = f(name(1:ntiso)),phas) | iqiso | 1:nqtot | 101 ! | iqWIsoPha | Index in "qx" = f(name(1:ntiso)),phas) | iqiso| 1:nqtot |103 ! | iqWIsoPha | Index in "qx" = f(name(1:ntiso+nqo)),phas) | / | 1:nqtot | 102 104 ! | itZonIso | Index in "trac(1:ntiso)"= f(zone, name(1:niso)) | index_trac | 1:ntiso | 103 105 ! +-----------------+--------------------------------------------------+--------------------+-----------------+ 104 106 107 !=== INDICES FOR WATER 108 INTEGER, SAVE :: ivap, iliq, isol 109 !$OMP THREADPRIVATE(ivap, iliq, isol) 110 105 111 !=== DIMENSIONS OF THE TRACERS TABLES AND OTHER SCALAR VARIABLES 106 INTEGER, SAVE :: nqtot, &!--- Tracers nb in dynamics (incl. higher moments + H2O)107 nbtr, &!--- Tracers nb in physics (excl. higher moments + H2O)108 nqo, &!--- Number of water phases112 INTEGER, SAVE :: nqtot, & !--- Tracers nb in dynamics (incl. higher moments + H2O) 113 nbtr, & !--- Tracers nb in physics (excl. higher moments + H2O) 114 nqo, & !--- Number of water phases 109 115 nqtottr, & !--- Number of tracers passed to phytrac (TO BE DELETED ?) 110 116 nqCO2 !--- Number of tracers of CO2 (ThL) … … 112 118 !$OMP THREADPRIVATE(nqtot, nbtr, nqo, nqtottr, nqCO2, type_trac) 113 119 114 !=== INDICES OF WATER115 INTEGER, SAVE :: ivap,iliq,isol ! Indices for vap, liq and ice116 !$OMP THREADPRIVATE(ivap,iliq,isol)117 118 120 !=== VARIABLES FOR INCA 119 INTEGER, SAVE, ALLOCATABLE :: conv_flg(:), & !--- Convection activation ; needed for INCA (nbtr)120 pbl_flg(:) !--- Boundary layer activation ; needed for INCA(nbtr)121 INTEGER, DIMENSION(:), SAVE, ALLOCATABLE :: & 122 conv_flg, pbl_flg !--- Convection / boundary layer activation (nbtr) 121 123 !$OMP THREADPRIVATE(conv_flg, pbl_flg) 122 124 123 #if def CPP_StratAer125 #if defined CPP_StratAer || defined REPROBUS 124 126 !=== SPECIFIC TO STRATOSPHERIC AEROSOLS (CK/OB) 125 127 INTEGER, SAVE :: nbtr_bin, nbtr_sulgas !--- number of aerosols bins and sulfur gases for StratAer model … … 173 175 CHARACTER(LEN=2) :: suff(9) !--- Suffixes for schemes of order 3 or 4 (Prather) 174 176 CHARACTER(LEN=3) :: descrq(30) !--- Advection scheme description tags 175 CHARACTER(LEN=maxlen) :: msg1, texp, ttp !--- String for messages and expanded tracers type177 CHARACTER(LEN=maxlen) :: msg1, texp, ttp !--- Strings for messages and expanded tracers type 176 178 INTEGER :: fType !--- Tracers description file type ; 0: none 177 179 !--- 1/2/3: "traceur.def"/"tracer.def"/"tracer_*.def" 178 180 INTEGER :: nqtrue !--- Tracers nb from tracer.def (no higher order moments) 179 181 INTEGER :: iad !--- Advection scheme number 180 INTEGER :: iq, jq, nt, im, nm , k!--- Indexes and temporary variables182 INTEGER :: iq, jq, nt, im, nm !--- Indexes and temporary variables 181 183 LOGICAL :: lerr, lInit 182 184 TYPE(trac_type), ALLOCATABLE, TARGET :: ttr(:) 183 185 TYPE(trac_type), POINTER :: t1, t(:) 184 CHARACTER(LEN=maxlen), ALLOCATABLE :: types_trac(:) !--- Keyword for tracers type(s), parsed version 185 186 CHARACTER(LEN=maxlen), ALLOCATABLE :: types_trac(:) !--- Keywords for tracers type(s), parsed version 186 187 CHARACTER(LEN=*), PARAMETER :: modname="init_infotrac_phy" 187 188 !------------------------------------------------------------------------------------------------------------------------------ … … 202 203 ENDIF 203 204 204 205 205 CALL msg('type_trac = "'//TRIM(type_trac)//'"', modname) 206 206 lInit = .NOT.ALLOCATED(tracers) … … 243 243 244 244 !============================================================================================================================== 245 ! 1) Get the numbers of: true (first order only) tracers "nqtrue", water tracers "nqo" (vapor/liquid/solid)246 !============================================================================================================================== 247 texp = type_trac !=== EXPANDED VERSION OF "type_trac", WITH "|" SEPARATOR245 ! 0) DETERMINE THE TYPE OF THE INPUT TRACERS DESCRIPTION FILE AND READ IT 246 !============================================================================================================================== 247 texp = type_trac !=== EXPANDED (WITH "|" SEPARATOR) "type_trac" 248 248 IF(texp == 'inco') texp = 'co2i|inca' 249 249 IF(texp /= 'lmdz') texp = 'lmdz|'//TRIM(texp) 250 251 !=== DETERMINE THE TYPE OF THE INPUT TRACERS DESCRIPTION FILE252 250 IF(testTracersFiles(modname, texp, fType, lInit)) CALL abort_physic(modname, 'problem with tracers file(s)',1) 253 254 251 ttp = type_trac; IF(fType /= 1) ttp = texp 255 252 … … 262 259 !############################################################################################################################## 263 260 264 !--------------------------------------------------------------------------------------------------------------------------- 265 IF(fType == 0) CALL abort_physic(modname, 'Missing tracers file: "traceur.def", "tracer.def" or "tracer_<keyword>.def file.',1) 266 !--------------------------------------------------------------------------------------------------------------------------- 267 IF(fType == 1 .AND. ANY(['inca','inco']==type_trac) .AND. lInit) THEN !=== FOUND OLD STYLE INCA "traceur.def" 261 !============================================================================================================================== 262 ! 1) Get various numbers: "nqtrue" (first order only tracers), "nqo" (water phases), 'nbtr' (tracers passed to physics), etc. 263 !============================================================================================================================== 264 !--------------------------------------------------------------------------------------------------------------------------- 265 IF(fType == 0) CALL abort_physic(modname, 'Missing "traceur.def", "tracer.def" or "tracer_<keyword>.def tracers file.',1) 266 !--------------------------------------------------------------------------------------------------------------------------- 267 IF(fType == 1 .AND. ANY(['inca', 'inco'] == type_trac) .AND. lInit) THEN !=== FOUND OLD STYLE INCA "traceur.def" 268 268 !--------------------------------------------------------------------------------------------------------------------------- 269 269 #ifdef INCA … … 281 281 ttr(1+nqo:nqCO2+nqo )%component = 'co2i' 282 282 ttr(1+nqo+nqCO2:nqtrue)%component = 'inca' 283 ttr(1+nqo :nqtrue)%name = [('CO2 ', k=1, nqCO2), solsym_inca]283 ttr(1+nqo :nqtrue)%name = [('CO2 ', iq=1, nqCO2), solsym_inca] 284 284 ttr(1+nqo+nqCO2:nqtrue)%parent = tran0 285 285 ttr(1+nqo+nqCO2:nqtrue)%phase = 'g' … … 302 302 ELSE !=== OTHER CASES (OLD OR NEW FORMAT, NO INCA MODULE) 303 303 !--------------------------------------------------------------------------------------------------------------------------- 304 nqo = COUNT(delPhase(tracers(:)%name) == 'H2O' & 305 .AND. tracers(:)%component == 'lmdz') !--- Number of water phases 306 nqtrue = SIZE(tracers) !--- Total number of "true" tracers 307 nbtr = nqtrue-COUNT(delPhase(tracers(:)%gen0Name) == 'H2O' & 308 .AND. tracers(:)%component == 'lmdz') !--- Number of tracers passed to phytrac 304 nqtrue = SIZE(tracers) !--- "true" tracers 305 nqo = COUNT(tracers(:)%component == 'lmdz' .AND. delPhase(tracers(:)%name) == 'H2O') !--- Water phases 306 nbtr = nqtrue-COUNT(tracers(:)%component == 'lmdz' .AND. delPhase(tracers(:)%gen0Name) == 'H2O') !--- Passed to phytrac 307 nqCO2 = COUNT( [type_trac == 'inco', type_trac == 'co2i'] ) 309 308 #ifdef INCA 310 nqINCA = COUNT(tracers(:)%component == 'inca') 311 #endif 312 lerr = getKey('hadv', hadv, ky=tracers(:)%keys) 313 lerr = getKey('vadv', vadv, ky=tracers(:)%keys) 314 !--------------------------------------------------------------------------------------------------------------------------- 315 END IF 316 !--------------------------------------------------------------------------------------------------------------------------- 317 318 !--- Transfert the number of tracers to Reprobus 309 nqINCA = COUNT(tracers(:)%component == 'inca') 310 #endif 311 IF(getKey('hadv', hadv, ky=tracers(:)%keys)) CALL abort_physic(modname, 'missing key "hadv"', 1) 312 IF(getKey('vadv', vadv, ky=tracers(:)%keys)) CALL abort_physic(modname, 'missing key "vadv"', 1) 313 !--------------------------------------------------------------------------------------------------------------------------- 314 END IF 315 !--------------------------------------------------------------------------------------------------------------------------- 316 319 317 #ifdef REPROBUS 320 CALL Init_chem_rep_trac(nbtr, nqo, tracers(:)%name) 318 CALL Init_chem_rep_trac(nbtr, nqo, tracers(:)%name) !--- Transfert the number of tracers to Reprobus 321 319 #endif 322 320 … … 359 357 IF(iad == -1) CALL abort_physic(modname, msg1, 1) 360 358 361 !--- SET FIELDS %longName, %isAdvected, %isInPhysics359 !--- SET FIELDS longName, isAdvected, isInPhysics 362 360 t1%longName = t1%name; IF(iad > 0) t1%longName=TRIM(t1%name)//descrq(iad) 363 361 t1%isAdvected = iad >= 0 364 t1%isInPhysics= delPhase(t1%gen0Name) /= 'H2O' & 365 .OR. t1%component /= 'lmdz' !=== OTHER EXCEPTIONS TO BE ADDED: CO2i, SURSATURATED WATER CLOUD... 362 t1%isInPhysics= delPhase(t1%gen0Name) /= 'H2O' .OR. t1%component /= 'lmdz' !=== MORE EXCEPTIONS ? CO2i, SURSAT CLOUD H2O 366 363 ttr(iq) = t1 367 364 … … 372 369 IF(nm == 0) CYCLE !--- No higher moments 373 370 ttr(jq+1:jq+nm) = t1 374 ttr(jq+1:jq+nm)%name = [(TRIM(t1%name) //'-'//TRIM(suff(im)), im=1, nm) ] 375 ttr(jq+1:jq+nm)%parent = [(TRIM(t1%parent) //'-'//TRIM(suff(im)), im=1, nm) ] 376 ttr(jq+1:jq+nm)%longName = [(TRIM(t1%longName)//'-'//TRIM(suff(im)), im=1, nm) ] 377 ttr(jq+1:jq+nm)%isAdvected = [(.FALSE., im=1, nm) ] 371 ttr(jq+1:jq+nm)%name = [ (TRIM(t1%name) //'-'//TRIM(suff(im)), im=1, nm) ] 372 ttr(jq+1:jq+nm)%gen0Name = [ (TRIM(t1%name) //'-'//TRIM(suff(im)), im=1, nm) ] 373 ttr(jq+1:jq+nm)%parent = [ (TRIM(t1%parent) //'-'//TRIM(suff(im)), im=1, nm) ] 374 ttr(jq+1:jq+nm)%longName = [ (TRIM(t1%longName)//'-'//TRIM(suff(im)), im=1, nm) ] 375 ttr(jq+1:jq+nm)%isAdvected = [ (.FALSE., im=1, nm) ] 376 ttr(jq+1:jq+nm)%isInPhysics = [ (.FALSE., im=1, nm) ] 378 377 jq = jq + nm 379 378 END DO … … 381 380 CALL MOVE_ALLOC(FROM=ttr, TO=tracers) 382 381 383 !--- SET FIELDS %iqParent, %nqChildren, %iGeneration, %iqDescen, %nqDescen384 IF(indexUpdate(tracers)) CALL abort_ gcm(modname, 'problem when processing isotopes parameters', 1)382 !--- SET FIELDS iqParent, iqDescen, nqDescen, nqChildren, iGeneration 383 IF(indexUpdate(tracers)) CALL abort_physic(modname, 'problem with tracers indices update', 1) 385 384 386 385 !############################################################################################################################## … … 404 403 !############################################################################################################################## 405 404 !--- Convection / boundary layer activation for all tracers 406 IF 407 IF (.NOT.ALLOCATED(pbl_flg)) ALLOCATE( pbl_flg(nbtr)); pbl_flg(1:nbtr) = 1405 IF(.NOT.ALLOCATED(conv_flg)) ALLOCATE(conv_flg(nbtr)); conv_flg(1:nbtr) = 1 406 IF(.NOT.ALLOCATED( pbl_flg)) ALLOCATE( pbl_flg(nbtr)); pbl_flg(1:nbtr) = 1 408 407 409 408 !--- Note: nqtottr can differ from nbtr when nmom/=0 … … 424 423 #endif 425 424 t => tracers 426 CALL msg('Information stored in infotrac_phy :', modname) 427 IF(dispTable('issssssssiiiiiiii', ['iq ', 'name', 'lNam', 'g0Nm', 'prnt', 'type', 'phas', 'comp', & 428 'isPh', 'iGen', 'iqPr', 'nqDe', 'nqCh', 'iGrp', 'iNam', 'iZon', 'iPha'], & 429 cat(t%name, t%longName, t%gen0Name, t%parent, t%type, t%phase, t%component, bool2str(t%isInPhysics)),& 425 CALL msg('Information stored in '//TRIM(modname)//': ', modname) 426 IF(dispTable('isssssssssiiiiiiii', ['iq ', 'name', 'lNam', 'g0Nm', 'prnt', 'type', 'phas', 'comp', & 427 'isPh', 'isAd', 'iGen', 'iqPr', 'nqDe', 'nqCh', 'iGrp', 'iNam', 'iZon', 'iPha'], & 428 cat(t%name, t%longName, t%gen0Name, t%parent, t%type, t%phase, t%component, & 429 bool2str(t%isInPhysics), bool2str(t%isAdvected)), & 430 430 cat([(iq, iq=1, nqtot)], t%iGeneration, t%iqParent, t%nqDescen, t%nqChildren, t%iso_iGroup, & 431 431 t%iso_iName, t%iso_iZone, t%iso_iPhase), nColMax=maxTableWidth, nHead=2, sub=modname)) & -
LMDZ6/branches/cirrus/libf/phylmd/lmdz_lscp.F90
r5202 r5203 1526 1526 znebprecipcld(i)=0.0 1527 1527 ENDIF 1528 !IF ( ((1-zfice(i))*zoliq(i) .GT. 0.) .AND. (zt(i) .LE. 233.15) ) THEN1529 !print*,'WARNING LEA OLIQ A <-40°C '1530 !print*,'zt,Tbef,oliq,oice,cldfraliq,icefrac,rneb',zt(i),Tbef(i),(1-zfice(i))*zoliq(i),zfice(i)*zoliq(i),cldfraliq(i,k),zfice(i),rneb(i,k)1531 !ENDIF1532 1528 ENDDO 1533 1529 -
LMDZ6/branches/cirrus/libf/phylmd/lmdz_wake.F90
r4908 r5203 1 1 MODULE lmdz_wake 2 2 3 ! $Id$ 3 USE lmdz_wake_ini, ONLY: CPPKEY_IOPHYS_WK 4 5 IMPLICIT NONE; PRIVATE 6 PUBLIC wake 4 7 5 8 CONTAINS … … 353 356 ! 354 357 IF (first_call) THEN 355 !!#define IOPHYS_WK 356 #undef IOPHYS_WK 357 #ifdef IOPHYS_WK 358 IF (CPPKEY_IOPHYS_WK) THEN 358 359 IF (phys_sub) THEN 359 360 call iophys_ini(dtimesub) … … 361 362 call iophys_ini(dtime) 362 363 ENDIF 363 #endif 364 END IF 364 365 first_call = .false. 365 366 ENDIF !(first_call) … … 771 772 772 773 END DO 773 #ifdef IOPHYS_WK 774 IF (CPPKEY_IOPHYS_WK) THEN 774 775 IF (.not.phys_sub) CALL iophys_ecrit('wape_a',1,'wape_a','J/kg',wape) 775 #endif 776 END IF 776 777 777 778 ! 2.2 Prognostic variable update … … 1007 1008 !!-------------------------------------------------------- 1008 1009 ELSEIF (iflag_wk_pop_dyn == 3) THEN 1009 #ifdef IOPHYS_WK 1010 IF (CPPKEY_IOPHYS_WK) THEN 1010 1011 IF (phys_sub) THEN 1011 1012 CALL iophys_ecrit('ptop',1,'ptop','Pa',ptop) … … 1018 1019 CALL iophys_ecrit('irad_wk',1,'irad_wk','m',irad_wk) 1019 1020 ENDIF 1020 #endif 1021 END IF 1021 1022 ! 1022 1023 CALL wake_popdyn_3 ( klon, klev, phys_sub, wk_adv, dtimesub, wgen, & … … 1072 1073 !!-------------------------------------------------------- 1073 1074 1074 #ifdef IOPHYS_WK 1075 IF (CPPKEY_IOPHYS_WK) THEN 1075 1076 IF (phys_sub) THEN 1076 1077 CALL iophys_ecrit('wdensa',1,'wdensa','m',wdens) … … 1079 1080 CALL iophys_ecrit('asigmawa',1,'asigmawa','m',asigmaw) 1080 1081 ENDIF 1081 #endif 1082 END IF 1082 1083 ! calcul de la difference de vitesse verticale poche - zone non perturbee 1083 1084 ! IM 060208 differences par rapport au code initial; init. a 0 dp_deltomg … … 1669 1670 END DO 1670 1671 1671 #ifdef IOPHYS_WK 1672 IF (CPPKEY_IOPHYS_WK) THEN 1672 1673 IF (phys_sub) THEN 1673 1674 CALL iophys_ecrit('wdensb',1,'wdensb','m',wdens) … … 1702 1703 CALL iophys_ecrit('d_asig_bnd2',1,'d_asig_bnd2','m',d_asig_bnd2) 1703 1704 ENDIF 1704 #endif 1705 END IF 1705 1706 ENDIF ! (iflag_wk_pop_dyn == 3) 1706 1707 ENDIF ! (iflag_wk_pop_dyn >= 2) … … 1866 1867 ! 1867 1868 1868 #ifdef IOPHYS_WK 1869 IF (CPPKEY_IOPHYS_WK) THEN 1869 1870 IF (.not.phys_sub) CALL iophys_ecrit('wape_b',1,'wape_b','J/kg',wape) 1870 #endif 1871 END IF 1871 1872 IF (prt_level>=10) THEN 1872 1873 PRINT *, 'wake-5, sigmaw(igout), cstar(igout), wape(igout), ptop(igout) ', & … … 2009 2010 END IF 2010 2011 END DO 2011 #ifdef IOPHYS_WK 2012 IF (CPPKEY_IOPHYS_WK) THEN 2012 2013 IF (.not.phys_sub) CALL iophys_ecrit('wape2_a',1,'wape2_a','J/kg',wape2) 2013 #endif 2014 END IF 2014 2015 2015 2016 … … 2041 2042 END DO 2042 2043 END IF 2043 #ifdef IOPHYS_WK 2044 IF (CPPKEY_IOPHYS_WK) THEN 2044 2045 IF (.not.phys_sub) CALL iophys_ecrit('wape2_b',1,'wape2_b','J/kg',wape2) 2045 #endif 2046 END IF 2046 2047 2047 2048 … … 2087 2088 gwake(i) = .TRUE. 2088 2089 END IF 2089 #ifdef IOPHYS_WK 2090 IF (CPPKEY_IOPHYS_WK) THEN 2090 2091 IF (.not.phys_sub) CALL iophys_ecrit('cstar2',1,'cstar2','J/kg',cstar2) 2091 #endif 2092 END IF 2092 2093 END IF ! (ok_qx_qw(i)) 2093 2094 END DO … … 2123 2124 END DO 2124 2125 IF (iflag_wk_pop_dyn >= 3) THEN 2125 #ifdef IOPHYS_WK 2126 IF (CPPKEY_IOPHYS_WK) THEN 2126 2127 IF (.not.phys_sub) THEN 2127 2128 CALL iophys_ecrit('fip',1,'fip','J/kg',fip) … … 2163 2164 CALL iophys_ecrit('d_asig_bnd2',1,'d_asig_bnd2','m',d_asig_bnd2) 2164 2165 ENDIF ! (.not.phys_sub) 2165 #endif 2166 END IF 2166 2167 ENDIF ! (iflag_wk_pop_dyn >= 3) 2167 2168 ! Limitation de sigmaw … … 2268 2269 wape(igout),wape2(igout),ktopw(igout),OK_qx_qw(igout) 2269 2270 ENDIF 2270 #ifdef IOPHYS_WK 2271 IF (CPPKEY_IOPHYS_WK) THEN 2271 2272 IF (.not.phys_sub) CALL iophys_ecrit('wape_c',1,'wape_c','J/kg',wape) 2272 #endif 2273 END IF 2273 2274 2274 2275 … … 3255 3256 d_sig_spread(i) = d_sig_spread(i)*dtimesub 3256 3257 d_sigmaw(i) = d_sig_gen(i) + d_sig_death(i) + d_sig_col(i) + d_sig_spread(i) 3257 #ifdef IOPHYS_WK 3258 IF (CPPKEY_IOPHYS_WK) THEN 3258 3259 IF (phys_sub) call iophys_ecrit('d_sigmaw0',1,'d_sigmaw0','',d_sigmaw) 3259 #endif 3260 END IF 3260 3261 3261 3262 … … 3266 3267 d_sigmaw(i) = d_sigmaw_targ 3267 3268 !! d_sigmaw(i) = max(d_sigmaw(i), sigmad-sigmaw(i)) 3268 #ifdef IOPHYS_WK 3269 IF (CPPKEY_IOPHYS_WK) THEN 3269 3270 IF (phys_sub) THEN 3270 3271 call iophys_ecrit('tauwk_inv',1,'tau_wk_inv_min','',tau_wk_inv_min) … … 3276 3277 call iophys_ecrit('d_sig_bnd',1,'d_sig_bnd','',d_sig_bnd) 3277 3278 ENDIF 3278 #endif 3279 END IF 3279 3280 d_asig_death(i) = - asigmaw(i)/tau_prime(i) 3280 3281 d_asig_aicol(i) = (agfl(i)*iwdens(i) + igfl(i)*awdens(i))*cstar(i)*is_wk(i) … … 3287 3288 d_asig_spread(i) = d_asig_spread(i)*dtimesub 3288 3289 d_asigmaw(i) = d_sig_gen(i) + d_asig_death(i) + d_asig_aicol(i) + d_asig_iicol(i) + d_asig_spread(i) 3289 #ifdef IOPHYS_WK 3290 IF (CPPKEY_IOPHYS_WK) THEN 3290 3291 IF (phys_sub) call iophys_ecrit('d_asigmaw0',1,'d_asigmaw0','',d_asigmaw) 3291 #endif 3292 END IF 3292 3293 3293 3294 d_sigmaw_targ = min(max(d_asigmaw(i),-asigmaw(i)), sigmaw(i)-asigmaw(i)) … … 3295 3296 d_asig_bnd(i) = d_sigmaw_targ - d_asigmaw(i) 3296 3297 d_asigmaw(i) = d_sigmaw_targ 3297 #ifdef IOPHYS_WK 3298 IF (CPPKEY_IOPHYS_WK) THEN 3298 3299 IF (phys_sub) THEN 3299 3300 call iophys_ecrit('d_asigmaw',1,'d_asigmaw','',d_asigmaw) … … 3304 3305 call iophys_ecrit('d_asig_bnd',1,'d_asig_bnd','',d_asig_bnd) 3305 3306 ENDIF 3306 #endif 3307 END IF 3307 3308 d_dens_gen(i) = wgen(i) 3308 3309 d_dens_death(i) = - iwdens(i)*tau_wk_inv_min … … 3318 3319 d_dens_bnd(i) = d_wdens_targ - d_wdens(i) 3319 3320 d_wdens(i) = d_wdens_targ 3320 #ifdef IOPHYS_WK 3321 IF (CPPKEY_IOPHYS_WK) THEN 3321 3322 IF (phys_sub) THEN 3322 3323 call iophys_ecrit('d_wdens',1,'d_wdens','',d_wdens) … … 3325 3326 call iophys_ecrit('d_dens_col',1,'d_dens_col','',d_dens_col) 3326 3327 ENDIF 3327 #endif 3328 END IF 3328 3329 3329 3330 d_adens_death(i) = -awdens(i)/tau_prime(i) … … 3335 3336 d_adens_acol(i) = d_adens_acol(i)*dtimesub 3336 3337 d_awdens(i) = d_dens_gen(i) + d_adens_death(i) + d_adens_icol(i) + d_adens_acol(i) 3337 #ifdef IOPHYS_WK 3338 IF (CPPKEY_IOPHYS_WK) THEN 3338 3339 IF (phys_sub) THEN 3339 3340 call iophys_ecrit('d_awdens',1,'d_awdens','',d_awdens) … … 3342 3343 call iophys_ecrit('d_adens_acol',1,'d_adens_acol','',d_adens_acol) 3343 3344 ENDIF 3344 #endif 3345 END IF 3345 3346 d_wdens_targ = min(max(d_awdens(i),-awdens(i)), wdens(i)-awdens(i)) 3346 3347 !! d_dens_bnd(i) = d_dens_bnd(i) + d_wdens_targ - d_wdens(i) -
LMDZ6/branches/cirrus/libf/phylmd/lmdz_wake_ini.F90
r4908 r5203 81 81 !$OMP THREADPRIVATE(wk_int_delta_t_min) 82 82 83 ! CPP key used only in this module for debugging purposes. jyg 09/24 84 !!#define IOPHYS_WK 85 #ifdef IOPHYS_WK 86 LOGICAL, PARAMETER :: CPPKEY_IOPHYS_WK = .TRUE. 87 #else 88 LOGICAL, PARAMETER :: CPPKEY_IOPHYS_WK = .FALSE. 89 #endif 90 83 91 84 92 -
LMDZ6/branches/cirrus/libf/phylmd/phyetat0_mod.F90
r4951 r5203 33 33 USE geometry_mod, ONLY: longitude_deg, latitude_deg 34 34 USE iostart, ONLY: close_startphy, get_field, get_var, open_startphy 35 USE infotrac_phy, ONLY: nqtot, nbtr, type_trac, tracers 36 USE readTracFiles_mod,ONLY: maxlen, new2oldH2O35 USE infotrac_phy, ONLY: nqtot, nbtr, type_trac, tracers, new2oldH2O 36 USE strings_mod, ONLY: maxlen 37 37 USE traclmdz_mod, ONLY: traclmdz_from_restart 38 38 USE carbon_cycle_mod, ONLY: carbon_cycle_init, carbon_cycle_cpl, carbon_cycle_tr, carbon_cycle_rad, co2_send, RCO2_glo -
LMDZ6/branches/cirrus/libf/phylmd/phys_local_var_mod.F90
r5202 r5203 400 400 REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: tpot, tpote, ue, uq, uwat, ve, vq, vwat, zxffonte 401 401 !$OMP THREADPRIVATE(tpot, tpote, ue, uq, uwat, ve, vq, vwat, zxffonte) 402 REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxustartlic, zxrhoslic, zxqsaltlic 403 !$OMP THREADPRIVATE(zxustartlic, zxrhoslic, zxqsaltlic )402 REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxustartlic, zxrhoslic, zxqsaltlic, tempsmoothlic 403 !$OMP THREADPRIVATE(zxustartlic, zxrhoslic, zxqsaltlic, tempsmoothlic) 404 404 REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxfqcalving 405 405 !$OMP THREADPRIVATE(zxfqcalving) … … 1051 1051 ALLOCATE(zxrunofflic(klon), runoff_diag(klon)) 1052 1052 runoff_diag(:)=0. 1053 ALLOCATE(zxustartlic(klon), zxrhoslic(klon), zxqsaltlic(klon) )1054 zxustartlic(:)=0. ; zxrhoslic(:)=0. ; zxqsaltlic(:)=0. 1053 ALLOCATE(zxustartlic(klon), zxrhoslic(klon), zxqsaltlic(klon), tempsmoothlic(klon)) 1054 zxustartlic(:)=0. ; zxrhoslic(:)=0. ; zxqsaltlic(:)=0. ; tempsmoothlic(:)=0. 1055 1055 ALLOCATE(rain_lsc(klon)) 1056 1056 ALLOCATE(rain_num(klon)) … … 1480 1480 ! SN runoff_diag 1481 1481 DEALLOCATE(zxrunofflic, runoff_diag) 1482 DEALLOCATE(zxustartlic, zxrhoslic, zxqsaltlic )1482 DEALLOCATE(zxustartlic, zxrhoslic, zxqsaltlic, tempsmoothlic) 1483 1483 DEALLOCATE(zxtsol, snow_lsc, zxfqfonte, zxqsurf) 1484 1484 DEALLOCATE(rain_lsc) -
LMDZ6/branches/cirrus/libf/phylmd/physiq_mod.F90
r5202 r5203 39 39 USE ioipsl_getin_p_mod, ONLY : getin_p 40 40 USE indice_sol_mod 41 USE infotrac_phy, ONLY: nqtot, nbtr, nqo, tracers, type_trac 42 USE readTracFiles_mod, ONLY: addPhase 41 USE infotrac_phy, ONLY: nqtot, nbtr, nqo, tracers, type_trac, addPhase 43 42 USE strings_mod, ONLY: strIdx 44 43 USE iophy … … 1270 1269 !albedo SB <<< 1271 1270 1271 !--Lea Raillard qs_ini 1272 REAL, dimension(klon,klev) :: qs_ini 1273 1272 1274 !--OB variables for mass fixer (hard coded for now) 1273 1275 REAL qql1(klon),qql2(klon),corrqql … … 2461 2463 ENDDO 2462 2464 ENDDO 2465 ! Lea Raillard qs_ini for cloud phase param. 2466 qs_ini(:,:)=qs_seri(:,:) 2463 2467 ! 2464 2468 !--OB water mass fixer … … 3858 3862 3859 3863 CALL lscp(klon,klev,phys_tstep,missing_val,paprs,pplay, & 3860 t_seri, q_seri,qs_ ancien,ptconv,ratqs, &3864 t_seri, q_seri,qs_ini,ptconv,ratqs, & 3861 3865 d_t_lsc, d_q_lsc, d_ql_lsc, d_qi_lsc, rneb, rneblsvol, & 3862 3866 pfraclr, pfracld, cldfraliq, sigma2_icefracturb, mean_icefracturb, & -
LMDZ6/branches/cirrus/libf/phylmd/surf_landice_mod.F90
r5202 r5203 36 36 USE cpl_mod, ONLY : cpl_send_landice_fields 37 37 USE calcul_fluxs_mod 38 USE phys_local_var_mod, ONLY : zxrhoslic, zxustartlic, zxqsaltlic 38 USE phys_local_var_mod, ONLY : zxrhoslic, zxustartlic, zxqsaltlic, tempsmoothlic 39 39 USE phys_output_var_mod, ONLY : snow_o,zfra_o 40 40 #ifdef ISO … … 185 185 186 186 REAL,DIMENSION(klon) :: alb1,alb2 187 REAL :: time_tempsmooth,coef_tempsmooth 187 188 REAL,DIMENSION(klon) :: precip_totsnow, evap_totsnow 188 189 REAL, DIMENSION (klon,6) :: alb6 … … 230 231 PRINT*, 'alb_nir_sno_lic',alb_nir_sno_lic 231 232 233 DO j=1,knon 234 i = knindex(j) 235 tempsmoothlic(i) = temp_air(j) 236 ENDDO 232 237 firstcall=.false. 233 238 ENDIF … … 445 450 z0h(1:knon) = z0h_landice 446 451 else 447 ! parameterization of z0=f(T) following measurements in Adelie Land by Amory et al 201 8452 ! parameterization of z0=f(T) following measurements in Adelie Land by Amory et al 2017 448 453 coefa = 0.1658 !0.1862 !Ant 449 454 coefb = -50.3869 !-55.7718 !Ant … … 456 461 coefc = log(z03/z02)/(ta3-ta2) 457 462 coefd = log(z03)-coefc*ta3 463 time_tempsmooth=2.*86400. 464 coef_tempsmooth=min(1.,dtime/time_tempsmooth) 465 !coef_tempsmooth=0. 458 466 do j=1,knon 459 if (temp_air(j) .lt. ta1) then 467 i=knindex(j) 468 tempsmoothlic(i)=temp_air(j)*coef_tempsmooth+tempsmoothlic(i)*(1.-coef_tempsmooth) 469 if (tempsmoothlic(i) .lt. ta1) then 460 470 z0m(j) = z01 461 else if (temp _air(j).ge.ta1 .and. temp_air(j).lt.ta2) then462 z0m(j) = exp(coefa*temp _air(j) + coefb)463 else if (temp _air(j).ge.ta2 .and. temp_air(j).lt.ta3) then471 else if (tempsmoothlic(i).ge.ta1 .and. tempsmoothlic(i).lt.ta2) then 472 z0m(j) = exp(coefa*tempsmoothlic(i) + coefb) 473 else if (tempsmoothlic(i).ge.ta2 .and. tempsmoothlic(i).lt.ta3) then 464 474 ! if st > 0, melting induce smooth surface 465 z0m(j) = exp(coefc*temp _air(j) + coefd)475 z0m(j) = exp(coefc*tempsmoothlic(i) + coefd) 466 476 else 467 477 z0m(j) = z03
Note: See TracChangeset
for help on using the changeset viewer.