Changeset 5756 for LMDZ6/trunk
- Timestamp:
- Jul 3, 2025, 3:25:59 PM (3 days ago)
- Location:
- LMDZ6/trunk/libf
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/trunk/libf/dyn3d_common/infotrac.f90
r5748 r5756 3 3 MODULE infotrac 4 4 5 USE strings_mod, ONLY: msg, maxlen, cat, dispTable, num2str, strStack, strParse, strCount, strIdx6 USE readTracFiles_mod, ONLY: trac_type, readTracersFiles, tracers, addPhase, addKey, iH2O, &7 isoSelect, indexUpdate, isot_type, testTracersFiles, isotope, delPhase, getKey, tran0, &8 isoKeys, isoName, isoZone, isoPhas, processIsotopes, isoCheck, itZonIso, nbIso, 9 niso, ntiso, nzone, nphas, maxTableWidth, iqIsoPha, iqWIsoPha, ixIso, new2oldH2O, newHNO3, oldHNO35 USE strings_mod, ONLY: msg, maxlen, cat, dispTable, num2str, strStack, strParse, strCount, strIdx, maxTableWidth 6 USE readTracFiles_mod, ONLY: trac_type, readTracersFiles, tracers, addPhase, addKey, iH2O, & 7 isoSelect, indexUpdate, isot_type, testTracersFiles, isotope, delPhase, getKey, tran0, & 8 isoKeys, isoName, isoZone, isoPhas, processIsotopes, isoCheck, itZonIso, nbIso, newHNO3, & 9 niso, ntiso, nzone, nphas, isoF=>isoFamilies,iqIsoPha, iqWIsoPha, ixIso, oldHNO3, new2oldH2O 10 10 IMPLICIT NONE 11 11 … … 22 22 !=== FOR ISOTOPES: General 23 23 PUBLIC :: isot_type, nbIso !--- Derived type, full isotopes families database + nb of families 24 PUBLIC :: isoSelect, ixIso !--- Isotopes familyselection tool + selected family index24 PUBLIC :: isoSelect, ixIso, isoFamilies !--- Isotopes families selection tool + selected family index 25 25 !=== FOR ISOTOPES: Specific to water 26 26 PUBLIC :: iH2O !--- Value of "ixIso" for "H2O" isotopes class … … 81 81 ! | iso_iName | Isotope name index in isotopes(iso_iGroup)%trac(:) | iso_indnum | 1:niso | 82 82 ! | iso_iZone | Isotope zone index in isotopes(iso_iGroup)%zone(:) | zone_num | 1:nzone | 83 ! | iso_iPhas 83 ! | iso_iPhase | Isotope phase index in isotopes(iso_iGroup)%phas(:) | phase_num | 1:nphas | 84 84 ! +-------------+------------------------------------------------------+-------------+------------------------+ 85 85 ! … … 98 98 ! +-----------------+--------------------------------------------------+--------------------+-----------------+ 99 99 100 !=== THRESHOLDS FOR WATER 100 101 REAL, PARAMETER :: min_qParent = 1.e-30, min_qMass = 1.e-18, min_ratio = 1.e-16 ! MVals et CRisi 101 102 102 !=== DIMENSIONS OF THE TRACERS TABLES AND OTHER SCALAR VARIABLES103 !=== DIMENSIONS OF THE TRACERS TABLES, TRACERS TYPE(S) 103 104 INTEGER, SAVE :: nqtot !--- Tracers nb in dynamics (incl. higher moments + H2O) 104 105 INTEGER, SAVE :: nbtr !--- Tracers nb in physics (excl. higher moments + H2O) … … 111 112 INTEGER, SAVE, ALLOCATABLE :: conv_flg(:), pbl_flg(:) !--- Convection / boundary layer activation (nbtr) 112 113 114 !=== LIST OF DEFINED ISOTOPES FAMILIES 115 CHARACTER(LEN=maxlen), SAVE, ALLOCATABLE :: isoFamilies(:) !--- Generation 0 tracer name for each isotopes family (nbIso) 116 113 117 CONTAINS 114 118 … … 116 120 USE iniprint_mod_h 117 121 USE control_mod, ONLY: planet_type 122 USE ioipsl, ONLY: getin 118 123 USE lmdz_reprobus_wrappers, ONLY: Init_chem_rep_trac 119 124 USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA, CPPKEY_REPROBUS, CPPKEY_STRATAER 120 125 USE dimensions_mod, ONLY: iim, jjm, llm, ndm 121 IMPLICIT NONE126 IMPLICIT NONE 122 127 !============================================================================================================================== 123 128 ! … … 152 157 INTEGER :: nqtrue !--- Tracers nb from tracer.def (no higher order moments) 153 158 INTEGER :: iad !--- Advection scheme number 154 INTEGER :: iq, jq, nt, im, nm, ig!--- Indexes and temporary variables159 INTEGER :: iq, jq, it, nt, im, nm, ig !--- Indexes and temporary variables 155 160 LOGICAL :: lerr 156 161 TYPE(trac_type), ALLOCATABLE, TARGET :: ttr(:) … … 284 289 IF(iad == -1) CALL abort_gcm(modname, msg1, 1) 285 290 286 !--- SET FIELDS longName andiadv291 !--- SET FIELDS longName AND iadv 287 292 t1%longName = t1%name; IF(iad > 0) t1%longName=TRIM(t1%name)//descrq(iad) 288 293 t1%iadv = iad … … 329 334 END DO 330 335 331 !=== READ PHYSICAL PARAMETERS FOR ISOTOPES ; DONE HERE BECAUSE dynetat0 AND iniacademic NEED "tnat" AND "alpha_ideal" 332 niso = 0; nzone = 0; nphas = nqo; ntiso = 0; isoCheck = .FALSE. 336 !=== DETERMINE ISOTOPES RELATED PARAMETERS ; DEFINE THE EXPLICIT KEYS iso_i* 333 337 IF(processIsotopes()) CALL abort_gcm(modname, 'problem when processing isotopes parameters', 1) 338 iH2O = -1 339 IF(nbIso /= 0) THEN 340 IF(isoSelect('H2O', .TRUE.)) THEN 341 IF(isoSelect(1, .TRUE.)) CALL abort_physic(modname, "Can't select the first isotopes family", 1) 342 ELSE 343 iH2O = ixIso; CALL getin('ok_iso_verif', isotope%check) 344 END IF 345 END IF 346 isoFamilies = isoF(:) 334 347 335 348 !--- Convection / boundary layer activation for all tracers … … 362 375 CALL msg('No isotopes identified.', modname, nbIso == 0) 363 376 IF(nbIso == 0) RETURN 364 CALL msg('For isotopes family "H2O":', modname) 365 CALL msg(' isoKeys%name = '//strStack(isoKeys%name), modname) 366 CALL msg(' isoName = '//strStack(isoName), modname) 367 CALL msg(' isoZone = '//strStack(isoZone), modname) 368 CALL msg(' isoPhas = '//TRIM(isoPhas), modname) 377 DO it = 1, nbIso 378 IF(isoSelect(it, .TRUE.)) CALL abort_physic(modname, 'Problem when selecting isotopes class', 1) 379 CALL msg('For isotopes family "'//TRIM(isoFamilies(it))//'":', modname) 380 CALL msg(' isoKeys%name = '//strStack(isoKeys%name), modname) 381 CALL msg(' isoName = '//strStack(isoName), modname) 382 CALL msg(' isoZone = '//strStack(isoZone), modname) 383 CALL msg(' isoPhas = '//TRIM(isoPhas), modname) 384 END DO 385 IF(isoSelect(iH2O, .TRUE.)) lerr = isoSelect(1, .TRUE.) 369 386 370 387 END SUBROUTINE init_infotrac -
LMDZ6/trunk/libf/misc/readTracFiles_mod.f90
r5755 r5756 2 2 3 3 USE ioipsl_getin_p_mod, ONLY : getin_p 4 USE strings_mod, ONLY: msg, find, dispTable, strHead, strReduce, strFind, strStack, strIdx, & 5 removeComment, cat, maxlen, checkList, strParse, strReplace, strTail, strCount, reduceExpr, & 6 num2str, str2int, str2real, str2bool 4 USE strings_mod, ONLY: msg, strIdx, dispTable, strHead, strReduce, strFind, strStack, removeComment, num2str, str2real, & 5 reduceExpr, find, cat, maxlen, checkList, strParse, strReplace, strTail, strCount, maxTableWidth, str2int, str2bool 7 6 8 7 IMPLICIT NONE … … 15 14 PUBLIC :: getKeysDBase, setKeysDBase !--- TOOLS TO GET/SET THE DATABASE (tracers & isotopes) 16 15 PUBLIC :: addTracer, delTracer !--- ADD/REMOVE A TRACER FROM 17 PUBLIC :: addKey, delKey, getKey, keys_type !--- TOOLS TO SET/DEL/GET KEYS FROM/TO tracers & isotopes 18 PUBLIC :: addPhase, delPhase, getPhase, getiPhase, & !--- FUNCTIONS RELATED TO THE PHASES 19 nphases, old_phases, phases_sep, known_phases, phases_names !--- + ASSOCIATED VARIABLES 16 PUBLIC :: addKey, delKey, getKey, keys_type !--- TOOLS TO SET/DEL/GET A KEY FROM/TO "tracers" / "isotopes" 17 PUBLIC :: addPhase, delPhase, getPhase, getiPhase !--- TOOLS TO SET/DEL/GET A PHASE FROM/TO A TRACER'S NAME 18 PUBLIC :: old_phases, phases_sep, nphases !--- VARIABLES RELATED TO THE PHASES 19 PUBLIC :: known_phases, phases_names 20 20 21 21 PUBLIC :: oldH2OIso, newH2OIso, old2newH2O, new2oldH2O !--- H2O ISOTOPES BACKWARD COMPATIBILITY (OLD traceur.def) … … 25 25 26 26 !=== FOR ISOTOPES: GENERAL 27 PUBLIC :: isot_type, processIsotopes, isoSelect, ixIso, nbIso !--- PROCESS [AND READ] & SELECT ISOTOPES + CLASS IDX & NUMBER 27 PUBLIC :: isot_type, processIsotopes, isoSelect, isoFamilies !--- ISOTOPES: TYPE, PROCESSING/SELECTION ROUTINES, FAMILIES NAMES 28 PUBLIC :: ixIso, nbIso !--- CURRENTLY SELECTED ISOTOPES FAMILY INDEX, NUMBER OF FAMILIES 28 29 29 30 !=== FOR ISOTOPES: H2O FAMILY ONLY 30 31 PUBLIC :: iH2O 31 32 32 !=== FOR ISOTOPES: DEPENDING ON THE SELECTED ISOTOPES CLASS33 !=== FOR ISOTOPES: DEPENDING ON THE SELECTED ISOTOPES FAMILY 33 34 PUBLIC :: isotope, isoKeys !--- SELECTED ISOTOPES DATABASE + ASSOCIATED KEYS 34 35 PUBLIC :: isoName, isoZone, isoPhas !--- ISOTOPES AND TAGGING ZONES NAMES AND PHASES … … 39 40 PUBLIC :: isoCheck !--- FLAG TO RUN ISOTOPES CHECKING ROUTINES 40 41 41 PUBLIC :: maxTableWidth42 42 !------------------------------------------------------------------------------------------------------------------------------ 43 43 TYPE :: keys_type !=== TYPE FOR A SET OF KEYS ASSOCIATED TO AN ELEMENT … … 142 142 TYPE(isot_type), ALLOCATABLE, TARGET, SAVE :: isotopes(:) 143 143 144 !--- NAMES OF THE ISOTOPES FAMILIES 145 CHARACTER(LEN=maxlen), SAVE, ALLOCATABLE :: isoFamilies(:) 146 144 147 !=== ALIASES OF VARIABLES FROM SELECTED ISOTOPES FAMILY EMBEDDED IN "isotope" (isotopes(ixIso)) 145 148 TYPE(isot_type), SAVE, POINTER :: isotope !--- CURRENTLY SELECTED ISOTOPES FAMILY DESCRIPTOR 146 INTEGER, SAVE :: ixIso, iH2O= 0 !--- Index of the selected isotopes family and H2O family147 INTEGER, SAVE :: nbIso !--- N umber of isotopes classes148 LOGICAL, SAVE :: isoCheck !--- F lag to trigger the checking routines149 INTEGER, SAVE :: ixIso, iH2O=-1 !--- INDEX OF THE SELECTED ISOTOPES FAMILY, H2O FAMILY INDEX 150 INTEGER, SAVE :: nbIso !--- NUMBER OF ISOTOPES FAMILIES 151 LOGICAL, SAVE :: isoCheck !--- FLAG TO TRIGGER THE CHECKING ROUTINES 149 152 TYPE(keys_type), SAVE, POINTER :: isoKeys(:) !--- ONE SET OF KEYS FOR EACH ISOTOPE (LISTED IN isoName) 150 153 CHARACTER(LEN=maxlen), SAVE, POINTER :: isoName(:), & !--- ISOTOPES NAMES FOR THE CURRENTLY SELECTED FAMILY … … 161 164 LOGICAL, PARAMETER :: lSortByGen = .TRUE. !--- Sort by growing generation 162 165 163 INTEGER, PARAMETER :: maxTableWidth = 192 !--- Maximum width of a table displayed with "dispTable"164 166 CHARACTER(LEN=maxlen) :: modname 165 167 … … 793 795 ! Purpose: Sort tracers: 794 796 ! * Put water at the beginning of the vector, in the "known_phases" order. 795 ! * l GrowGen == T: in ascending generations numbers.796 ! * l GrowGen == F: tracer + its children sorted by growing generation, one after the other.797 ! * lSortByGen == T: in ascending generations numbers. 798 ! * lSortByGen == F: tracer + its children sorted by growing generation, one after the other. 797 799 ! TO BE ADDED IF NECESSARY: HIGHER MOMENTS AT THE END 798 800 !------------------------------------------------------------------------------------------------------------------------------ … … 1100 1102 !=== READ FILE "fnam" TO APPEND THE "dBase" TRACERS DATABASE WITH AS MUCH SECTIONS AS PARENTS NAMES IN "isot(:)%parent": ==== 1101 1103 !=== * Each section dBase(i)%name contains the isotopes "dBase(i)%trac(:)" descending on "dBase(i)%name"="iso(i)%parent" ==== 1102 !=== * For each isotopes class, the <key>=<val> vector of each tracer is moved into the isotopes descriptor "isot"====1104 !=== * For each isotopes family, the <key>=<val> vector of each tracer is moved into the isotopes descriptor "isot" ==== 1103 1105 !=== NOTES: ==== 1104 1106 !=== * Most of the "isot" components have been defined in the calling routine (processIsotopes): ==== … … 1125 1127 CALL msg('Missing isotopes parameters file "'//TRIM(fnam)//'"', modname, lerr); IF(lerr) RETURN 1126 1128 1127 !--- READ THE FILE SECTIONS, ONE EACH PARENT TRACER1129 !--- READ THE FILE SECTIONS, ONE EACH ISOTOPES FAMILY 1128 1130 nb0 = SIZE(dBase, DIM=1)+1 !--- Next database element index 1129 lerr = readSections(fnam,strStack(isot(:)%parent,'|')); IF(lerr) RETURN !--- Read sections, one each parent tracer1131 lerr = readSections(fnam,strStack(isot(:)%parent,'|')); IF(lerr) RETURN !--- Read sections, one each isotopes family 1130 1132 ndb = SIZE(dBase, DIM=1) !--- Current database size 1131 1133 DO idb = nb0, ndb … … 1163 1165 END IF 1164 1166 1165 !--- GET THE isoCheck ENTRY FROM THE *.DEF FILES (MIGHT BE CHANGED TO A CLASS-DEPENDANT KEYWORD)1166 CALL getin_p('ok_iso_verif', isot(strIdx(isot%parent, 'H2O'))%check, .FALSE.)1167 1168 1167 lerr = dispIsotopes() 1169 1168 … … 1176 1175 CHARACTER(LEN=maxlen), ALLOCATABLE :: ttl(:), val(:,:) 1177 1176 CALL msg('Isotopes parameters read from file "'//TRIM(fnam)//'":', modname) 1178 DO ip = 1, SIZE(isot) !--- Loop on parents tracers1177 DO ip = 1, SIZE(isot) !--- Loop on isotopes families 1179 1178 nk = SIZE(isot(ip)%keys(1)%key) !--- Same keys for each isotope 1180 1179 nt = SIZE(isot(ip)%keys) !--- Number of isotopes … … 1230 1229 lerr = getKey('iGeneration', iGen, t%keys); IF(lerr) RETURN !--- Generation number 1231 1230 1232 !--- GET FROM "tracers" THE FULL LIST OF AVAILABLE ISOTOPES CLASSES1231 !--- GET FROM "tracers" THE FULL LIST OF AVAILABLE ISOTOPES FAMILIES 1233 1232 p = PACK(delPhase(parent), MASK = dType=='tracer' .AND. iGen==1) 1234 1233 CALL strReduce(p, nbIso) 1235 1234 1236 !--- CHECK WHETHER NEEDED ISOTOPES CLASSES "iNames" ARE AVAILABLE OR NOT1235 !--- CHECK WHETHER NEEDED ISOTOPES FAMILIES "iNames" ARE AVAILABLE OR NOT 1237 1236 IF(PRESENT(iNames)) THEN 1238 1237 DO it = 1, SIZE(iNames) 1239 1238 lerr = ALL(p /= iNames(it)) 1240 CALL msg('No isotopes class"'//TRIM(iNames(it))//'" found among tracers', modname, lerr); IF(lerr) RETURN1239 CALL msg('No isotopes family "'//TRIM(iNames(it))//'" found among tracers', modname, lerr); IF(lerr) RETURN 1241 1240 END DO 1242 1241 p = iNames; nbIso = SIZE(p) 1243 1242 END IF 1244 1243 IF(ALLOCATED(isotopes)) DEALLOCATE(isotopes) 1245 ALLOCATE(isotopes(nbIso) )1244 ALLOCATE(isotopes(nbIso), isoFamilies(nbIso)) 1246 1245 1247 1246 IF(nbIso==0) RETURN !=== NO ISOTOPES: FINISHED … … 1249 1248 !--- ISOTOPES RELATED VARIABLES ; NULL OR EMPTY IF NO ISOTOPES 1250 1249 isotopes(:)%parent = p 1251 DO ic = 1, SIZE(p) !--- Loop on isotopes classes1250 DO ic = 1, SIZE(p) !--- Loop on isotopes families 1252 1251 i => isotopes(ic) 1253 iname = i%parent !--- Current isotopes classname (parent tracer name)1252 iname = i%parent !--- Current isotopes family name (parent tracer name) 1254 1253 1255 1254 !=== Isotopes children of tracer "iname": mask, names, number (same for each phase of "iname") … … 1315 1314 !=== SELECT WATER ISOTOPES CLASS OR, IF UNFOUND, THE FIRST ISOTOPES CLASS 1316 1315 IF(.NOT.isoSelect('H2O', .TRUE.)) THEN; iH2O = ixIso; ELSE; lerr = isoSelect(1, .TRUE.); END IF 1316 1317 !=== COLLECT THE NAMES OF THE ISOTOPES FAMILIES 1318 isoFamilies = isotopes(:)%parent 1317 1319 1318 1320 CONTAINS … … 1348 1350 !============================================================================================================================== 1349 1351 !=== THE ROUTINE isoSelect IS USED TO SWITCH FROM AN ISOTOPE FAMILY TO ANOTHER: ISOTOPES DEPENDENT PARAMETERS ARE UPDATED 1350 ! Single generic "isoSelect" routine, using the predefined index of the parent(fast version) or its name (first call).1352 ! Single generic "isoSelect" routine, using the predefined index of the family (fast version) or its name (first call). 1351 1353 !============================================================================================================================== 1352 1354 LOGICAL FUNCTION isoSelectByName(iName, lVerbose) RESULT(lerr) … … 1540 1542 ! IF(jd == 0) RETURN 1541 1543 ! DO ik = 1, SIZE(t(jd)%keys%key) 1542 ! CALL get _in(t(jd)%keys%key(ik), val, '*none*')1544 ! CALL getin_p(t(jd)%keys%key(ik), val, '*none*') 1543 1545 ! IF(val /= '*none*') CALL addKey(t(jd)%keys%key(ik), val, t(jd)%keys, .TRUE.) 1544 1546 ! END DO -
LMDZ6/trunk/libf/phylmd/infotrac_phy.F90
r5748 r5756 3 3 MODULE infotrac_phy 4 4 5 USE strings_mod, ONLY: msg, maxlen, cat, dispTable, num2str, strStack, strParse, strCount, strIdx 5 USE strings_mod, ONLY: msg, maxlen, cat, dispTable, num2str, strStack, strParse, strCount, strIdx, maxTableWidth 6 6 USE readTracFiles_mod, ONLY: trac_type, readTracersFiles, tracers, addPhase, addKey, iH2O, & 7 7 isoSelect, indexUpdate, isot_type, testTracersFiles, isotope, delPhase, getKey, tran0, & 8 8 isoKeys, isoName, isoZone, isoPhas, processIsotopes, isoCheck, itZonIso, nbIso, & 9 niso, ntiso, nzone, nphas, maxTableWidth,iqIsoPha, iqWIsoPha, ixIso, new2oldH2O9 niso, ntiso, nzone, nphas, isoF=>isoFamilies,iqIsoPha, iqWIsoPha, ixIso, new2oldH2O 10 10 IMPLICIT NONE 11 11 … … 24 24 !=== FOR ISOTOPES: General 25 25 PUBLIC :: isot_type, nbIso !--- Derived type, full isotopes families database + nb of families 26 PUBLIC :: isoSelect, ixIso 26 PUBLIC :: isoSelect, ixIso, isoFamilies !--- Isotopes family selection tool + selected family index 27 27 !=== FOR ISOTOPES: Specific to water 28 28 PUBLIC :: iH2O !--- Value of "ixIso" for "H2O" isotopes class … … 84 84 ! | iso_iName | Isotope name index in isotopes(iso_iGroup)%trac(:) | iso_indnum | 1:niso | 85 85 ! | iso_iZone | Isotope zone index in isotopes(iso_iGroup)%zone(:) | zone_num | 1:nzone | 86 ! | iso_iPhas 86 ! | iso_iPhase | Isotope phase index in isotopes(iso_iGroup)%phas(:) | phase_num | 1:nphas | 87 87 ! +-------------+------------------------------------------------------+-------------+------------------------+ 88 88 ! … … 106 106 !$OMP THREADPRIVATE(ivap, iliq, isol, ibs, icf, irvc) 107 107 108 !=== DIMENSIONS OF THE TRACERS TABLES AND OTHER SCALAR VARIABLES108 !=== DIMENSIONS OF THE TRACERS TABLES, TRACERS TYPE(S) 109 109 INTEGER, SAVE :: nqtot !--- Tracers nb in dynamics (incl. higher moments + H2O) 110 110 INTEGER, SAVE :: nbtr !--- Tracers nb in physics (excl. higher moments + H2O) … … 118 118 INTEGER, SAVE, ALLOCATABLE :: conv_flg(:), pbl_flg(:) !--- Convection / boundary layer activation (nbtr) 119 119 !$OMP THREADPRIVATE(conv_flg, pbl_flg) 120 121 !=== LIST OF DEFINED ISOTOPES FAMILIES 122 CHARACTER(LEN=maxlen), SAVE, ALLOCATABLE :: isoFamilies(:) !--- Generation 0 tracer name for each isotopes family (nbIso) 123 !$OMP THREADPRIVATE(isoFamilies) 120 124 121 125 !=== SPECIFIC TO STRATOSPHERIC AEROSOLS (CK/OB) … … 167 171 INTEGER :: nqtrue !--- Tracers nb from tracer.def (no higher order moments) 168 172 INTEGER :: iad !--- Advection scheme number 169 INTEGER :: iq, jq, nt, im, nm!--- Indexes and temporary variables173 INTEGER :: iq, jq, it, nt, im, nm !--- Indexes and temporary variables 170 174 LOGICAL :: lerr, lInit 171 175 TYPE(trac_type), ALLOCATABLE, TARGET :: ttr(:) … … 294 298 IF(iad == -1) CALL abort_physic(modname, msg1, 1) 295 299 296 !--- SET FIELDS longName ,isInPhysics300 !--- SET FIELDS longName AND isInPhysics 297 301 t1%longName = t1%name; IF(iad > 0) t1%longName=TRIM(t1%name)//descrq(iad) 298 302 t1%isInPhysics= iad >= 0 .AND. (delPhase(t1%gen0Name) /= 'H2O' .OR. t1%component /= 'lmdz') … … 315 319 CALL MOVE_ALLOC(FROM=ttr, TO=tracers) 316 320 317 !--- SET FIELDS iqParent, iqDescen, nqDescen, nqChildren , iGeneration321 !--- SET FIELDS iqParent, iqDescen, nqDescen, nqChildren 318 322 IF(indexUpdate(tracers)) CALL abort_physic(modname, 'problem with tracers indices update', 1) 319 323 320 !=== READ PHYSICAL PARAMETERS FOR ISOTOPES 321 niso = 0; nzone = 0; nphas = nqo; ntiso = 0; isoCheck = .FALSE. 324 !=== DETERMINE ISOTOPES RELATED PARAMETERS ; DEFINE THE EXPLICIT KEYS iso_i* 322 325 IF(processIsotopes()) CALL abort_physic(modname, 'Problem when processing isotopes parameters', 1) 326 iH2O = -1 327 IF(nbIso /= 0) THEN 328 IF(isoSelect('H2O', .TRUE.)) THEN 329 IF(isoSelect(1, .TRUE.)) CALL abort_physic(modname, "Can't select the first isotopes family", 1) 330 ELSE 331 iH2O = ixIso; CALL getin_p('ok_iso_verif', isotope%check) 332 END IF 333 END IF 323 334 324 335 !############################################################################################################################## … … 326 337 !############################################################################################################################## 327 338 DO iq = 1, nqtrue 328 t1 => tracers(iq)329 339 IF(hadv(iq) == vadv(iq) ) iad = hadv(iq) 330 340 IF(hadv(iq)==10 .AND. vadv(iq)==16) iad = 11 331 tracers(iq)%isInPhysics= iad >= 0 .AND. (delPhase(t 1%gen0Name) /= 'H2O' .OR. t1%component /= 'lmdz')341 tracers(iq)%isInPhysics= iad >= 0 .AND. (delPhase(tracers(iq)%gen0Name) /= 'H2O' .OR. tracers(iq)%component /= 'lmdz') 332 342 END DO 333 !############################################################################################################################## 334 END IF 335 !############################################################################################################################## 343 tracers(nqtrue+1:nqtot)%isInPhysics = .FALSE. 344 !############################################################################################################################## 345 END IF 346 !############################################################################################################################## 347 isoFamilies = isoF(:) 336 348 337 349 !--- Convection / boundary layer activation for all tracers … … 377 389 IF(dispTable('issssssssiiiiiiii', ['iq ', 'name', 'lNam', 'g0Nm', 'prnt', 'type', 'phas', 'comp', & 378 390 'isPh', 'iGen', 'iqPr', 'nqDe', 'nqCh', 'iGrp', 'iNam', 'iZon', 'iPha'], & 379 cat(t%name, t%longName, t%gen0Name, t%parent, t%type, t%phase, t%component, num2str(t%isInPhysics)),&391 cat(t%name, t%longName, t%gen0Name, t%parent, t%type, t%phase, t%component, num2str(t%isInPhysics)),& 380 392 cat([(iq, iq=1, nqtot)], t%iGeneration, t%iqParent, t%nqDescen, t%nqChildren, t%iso_iGroup, & 381 393 t%iso_iName, t%iso_iZone, t%iso_iPhase), nColMax=maxTableWidth, nHead=2, sub=modname)) & … … 383 395 CALL msg('No isotopes identified.', modname, nbIso == 0) 384 396 IF(nbIso == 0) RETURN 385 CALL msg('For isotopes family "H2O":', modname) 386 CALL msg(' isoKeys%name = '//strStack(isoKeys%name), modname) 387 CALL msg(' isoName = '//strStack(isoName), modname) 388 CALL msg(' isoZone = '//strStack(isoZone), modname) 389 CALL msg(' isoPhas = '//TRIM(isoPhas), modname) 397 DO it = 1, nbIso 398 IF(isoSelect(it, .TRUE.)) CALL abort_physic(modname, 'Problem when selecting isotopes class', 1) 399 CALL msg('For isotopes family "'//TRIM(isoFamilies(it))//'":', modname) 400 CALL msg(' isoKeys%name = '//strStack(isoKeys%name), modname) 401 CALL msg(' isoName = '//strStack(isoName), modname) 402 CALL msg(' isoZone = '//strStack(isoZone), modname) 403 CALL msg(' isoPhas = '//TRIM(isoPhas), modname) 404 END DO 405 IF(isoSelect(iH2O, .TRUE.)) lerr = isoSelect(1, .TRUE.) 390 406 391 407 IF(CPPKEY_STRATAER .AND. type_trac == 'coag') THEN -
LMDZ6/trunk/libf/phylmdiso/isotopes_mod.F90
r5754 r5756 4 4 MODULE isotopes_mod 5 5 USE strings_mod, ONLY: msg, num2str, maxlen, strIdx, strStack 6 USE infotrac_phy, ONLY: isoName, niso, ntiso 6 USE infotrac_phy, ONLY: isoName, niso, ntiso, nbIso, isoFamilies, isoSelect, isoCheck 7 7 USE iso_params_mod 8 8 USE ioipsl_getin_p_mod, ONLY : getin_p … … 150 150 151 151 !=== Local variables: 152 INTEGER :: ixt, is 152 INTEGER :: ixt, is, ii 153 153 LOGICAL :: ltnat1 154 154 CHARACTER(LEN=maxlen) :: modname, sxt … … 175 175 CALL msg('64: niso = '//TRIM(num2str(niso)), modname) 176 176 177 DO ii = 1, nbIso 178 CALL msg('Can''t select isotopes class "'//TRIM(isoFamilies(ii))//'"', modname, isoSelect(ii, lVerbose=.TRUE.)) 179 180 !============================================================================================================================== 181 IF(isoFamilies(ii) == 'H2O') THEN 182 !============================================================================================================================== 177 183 !--- Init de ntracisoOR: on ecrasera en cas de traceurs de tagging isotopiques 178 184 ! (nzone>0) si complications avec ORCHIDEE … … 203 209 CALL getin_p( 'sstlatcrit', sstlatcrit, 30.0) !--- For modif_sst>=3 204 210 CALL getin_p('dsstlatcrit', dsstlatcrit, 0.0) !--- For modif_sst>=3 205 #ifdef ISOVERIF 211 IF(isoCheck) THEN 206 212 CALL msg('iso_init 270: sstlatcrit='//num2str( sstlatcrit), modname, sstlatcrit < 0.0) !--- For modif_sst>=2 207 213 CALL msg('iso_init 279: dsstlatcrit='//num2str(dsstlatcrit), modname, sstlatcrit < 0.0) !--- For modif_sst>=3 208 214 IF(modif_sst >= 2 .AND. sstlatcrit < 0.0) STOP 209 #endif 210 215 END IF 211 216 CALL getin_p('modif_sic', modif_sic, 0) 212 217 IF(modif_sic >= 1) & … … 238 243 CALL getin_p('A_satlim', A_satlim, 1.0) 239 244 CALL getin_p('ok_restrict_A_satlim', ok_restrict_A_satlim, 0) 240 #ifdef ISOVERIF 245 IF(isoCheck) THEN 241 246 CALL msg(' 315: A_satlim='//TRIM(num2str(A_satlim)), modname, A_satlim > 1.0) 242 247 IF(A_satlim > 1.0) STOP 243 #endif 248 END IF 244 249 ! CALL getin_p('slope_limiterxy', slope_limiterxy, 2.0) 245 250 ! CALL getin_p('slope_limiterz', slope_limiterz, 2.0) … … 374 379 CALL msg('69: h_land_ice = '//TRIM(num2str(h_land_ice)), modname) 375 380 CALL msg('69: P_veg = '//TRIM(num2str(P_veg)), modname) 381 !============================================================================================================================== 382 ELSE 383 !============================================================================================================================== 384 CALL abort_physic('"isotopes_mod" is not set up yet for isotopes family "'//TRIM(isoFamilies(ii))//'"', modname, 1) 385 !============================================================================================================================== 386 END IF 387 !============================================================================================================================== 388 END DO 376 389 377 390 END SUBROUTINE iso_init 378 379 380 SUBROUTINE getinp_s(nam, val, def, lDisp)381 USE ioipsl, ONLY: getin382 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root383 USE mod_phys_lmdz_omp_data, ONLY : is_omp_root384 USE mod_phys_lmdz_transfert_para, ONLY : bcast385 CHARACTER(LEN=*), INTENT(IN) :: nam386 CHARACTER(LEN=*), INTENT(INOUT) :: val387 CHARACTER(LEN=*), OPTIONAL, INTENT(IN) :: def388 LOGICAL, OPTIONAL, INTENT(IN) :: lDisp389 LOGICAL :: lD390 !$OMP BARRIER391 IF(is_mpi_root.AND.is_omp_root) THEN392 IF(PRESENT(def)) val=def; CALL getin(nam,val)393 lD=.TRUE.; IF(PRESENT(lDisp)) lD=lDisp394 IF(lD) CALL msg(TRIM(nam)//' = '//TRIM(val))395 END IF396 CALL bcast(val)397 END SUBROUTINE getinp_s398 399 SUBROUTINE getinp_i(nam, val, def, lDisp)400 USE ioipsl, ONLY: getin401 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root402 USE mod_phys_lmdz_omp_data, ONLY : is_omp_root403 USE mod_phys_lmdz_transfert_para, ONLY : bcast404 CHARACTER(LEN=*), INTENT(IN) :: nam405 INTEGER, INTENT(INOUT) :: val406 INTEGER, OPTIONAL, INTENT(IN) :: def407 LOGICAL, OPTIONAL, INTENT(IN) :: lDisp408 LOGICAL :: lD409 !$OMP BARRIER410 IF(is_mpi_root.AND.is_omp_root) THEN411 IF(PRESENT(def)) val=def; CALL getin(nam,val)412 lD=.TRUE.; IF(PRESENT(lDisp)) lD=lDisp413 IF(lD) CALL msg(TRIM(nam)//' = '//TRIM(num2str(val)))414 END IF415 CALL bcast(val)416 END SUBROUTINE getinp_i417 418 SUBROUTINE getinp_r(nam, val, def, lDisp)419 USE ioipsl, ONLY: getin420 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root421 USE mod_phys_lmdz_omp_data, ONLY : is_omp_root422 USE mod_phys_lmdz_transfert_para, ONLY : bcast423 CHARACTER(LEN=*), INTENT(IN) :: nam424 REAL, INTENT(INOUT) :: val425 REAL, OPTIONAL, INTENT(IN) :: def426 LOGICAL, OPTIONAL, INTENT(IN) :: lDisp427 LOGICAL :: lD428 !$OMP BARRIER429 IF(is_mpi_root.AND.is_omp_root) THEN430 IF(PRESENT(def)) val=def; CALL getin(nam,val)431 lD=.TRUE.; IF(PRESENT(lDisp)) lD=lDisp432 IF(lD) CALL msg(TRIM(nam)//' = '//TRIM(num2str(val)))433 END IF434 CALL bcast(val)435 END SUBROUTINE getinp_r436 437 SUBROUTINE getinp_l(nam, val, def, lDisp)438 USE ioipsl, ONLY: getin439 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root440 USE mod_phys_lmdz_omp_data, ONLY : is_omp_root441 USE mod_phys_lmdz_transfert_para, ONLY : bcast442 CHARACTER(LEN=*), INTENT(IN) :: nam443 LOGICAL, INTENT(INOUT) :: val444 LOGICAL, OPTIONAL, INTENT(IN) :: def445 LOGICAL, OPTIONAL, INTENT(IN) :: lDisp446 LOGICAL :: lD447 !$OMP BARRIER448 IF(is_mpi_root.AND.is_omp_root) THEN449 IF(PRESENT(def)) val=def; CALL getin(nam,val)450 lD=.TRUE.; IF(PRESENT(lDisp)) lD=lDisp451 IF(lD) CALL msg(TRIM(nam)//' = '//TRIM(num2str(val)))452 END IF453 CALL bcast(val)454 END SUBROUTINE getinp_l455 391 456 392 END MODULE isotopes_mod
Note: See TracChangeset
for help on using the changeset viewer.