Changeset 20 for readTracFiles_mod.f90
- Timestamp:
- Jul 4, 2022, 11:49:29 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
readTracFiles_mod.f90
r19 r20 21 21 22 22 PUBLIC :: tran0, idxAncestor, ancestor !--- GENERATION 0 TRACER + TOOLS FOR GENERATIONS 23 PUBLIC :: maxTableWidth 23 24 !------------------------------------------------------------------------------------------------------------------------------ 24 25 TYPE :: dataBase_type !=== TYPE FOR TRACERS SECTION … … 59 60 CHARACTER(LEN=maxlen), SAVE :: newH2OIso(5) = ['H2[16]O', 'H[2]HO ', 'H2[18]O', 'H2[17]O', 'H[3]HO '] 60 61 61 62 62 !=== LOCAL COPIES OF THE TRACERS AND ISOTOPES DESCRIPTORS, USED BY getKey (INITIALIZED IN getKey_init) 63 63 TYPE(trac_type), ALLOCATABLE, TARGET, SAVE :: tracers(:) 64 64 TYPE(isot_type), ALLOCATABLE, TARGET, SAVE :: isotopes(:) 65 65 66 INTEGER, PARAMETER :: maxTableWidth = 192 !--- Maximum width of a table displayed with "dispTable" 66 67 CHARACTER(LEN=maxlen) :: modname 67 68 … … 267 268 TYPE(trac_type), ALLOCATABLE :: tt(:) 268 269 TYPE(trac_type) :: tmp 269 CHARACTER(LEN=1024) :: str 270 CHARACTER(LEN=1024) :: str, str2 270 271 CHARACTER(LEN=maxlen) :: secn 271 272 INTEGER :: ierr, n … … 273 274 IF(.NOT.ALLOCATED(dBase)) ALLOCATE(dBase(0)) 274 275 OPEN(90, FILE=fnam, FORM='formatted', STATUS='old') 275 DO; READ(90,'(a)', IOSTAT=ierr)str 276 DO; str='' 277 DO 278 READ(90,'(a)', IOSTAT=ierr)str2 !--- Read a full line 279 str=TRIM(str)//' '//TRIM(str2) !--- Append "str" with the current line 280 n=LEN_TRIM(str); IF(n == 0) EXIT !--- Empty line (probably end of file) 281 IF(IACHAR(str(n:n)) /= 92) EXIT !--- No "\" continuing line symbol found => end of line 282 str = str(1:n-1) !--- Remove the "\" continuing line symbol 283 END DO 284 str = ADJUSTL(str) !--- Remove the front space 276 285 IF(ierr /= 0 ) EXIT !--- Finished: error or end of file 277 286 IF(str(1:1)=='#') CYCLE !--- Skip comments lines … … 777 786 phas = [(fgetKey(iq, 'phases',tm(:)%keys, 'g' ), iq=1, nq)] 778 787 CALL msg(TRIM(message)//':', modname) 779 IF( tm(1)%parent == '') THEN780 IF(test(dispTable('iiiss', ['iq ','hadv ','vadv ','name ','phase '], cat(tm%name, phas), cat([(iq, iq=1, nq)],&781 hadv, vadv),sub=modname), lerr)) RETURN788 IF(ALL(tm(:)%parent == '')) THEN 789 IF(test(dispTable('iiiss', ['iq ','hadv ','vadv ','name ','phase '], cat(tm%name, phas), & 790 cat([(iq, iq=1, nq)], hadv, vadv), nColMax=maxTableWidth, nHead=2, sub=modname), lerr)) RETURN 782 791 ELSE 783 792 IF(test(dispTable('iiissis', ['iq ','hadv ','vadv ','name ','parent','igen ','phase '], cat(tm%name, tm%parent, & 784 tm%phase), cat([(iq, iq=1, nq)], hadv, vadv, tm%iGeneration), sub=modname), lerr)) RETURN793 tm%phase), cat([(iq, iq=1, nq)], hadv, vadv, tm%iGeneration), nColMax=maxTableWidth, nHead=2, sub=modname), lerr)) RETURN 785 794 END IF 786 795 END FUNCTION dispTraSection … … 933 942 CALL get_in('ok_iso_verif', isot(strIdx(isot%parent, 'H2O'))%check, .FALSE.) 934 943 935 lerr = dispIsotopes(isot, 'Isotopes parameters read from file ', modname)944 lerr = dispIsotopes(isot, 'Isotopes parameters read from file "'//TRIM(fnam)//'"', modname) 936 945 937 946 END FUNCTION readIsotopesFile … … 945 954 !=== NOTE: THIS IS DONE HERE (IN A ROUTINE CALLED BY THE DYNAMIC), BECAUSE THE DYNAMIC NEEDS FEW PHYSICAL PARAMETERS. === 946 955 !============================================================================================================================== 947 SUBROUTINE initIsotopes(trac, isot)956 LOGICAL FUNCTION initIsotopes(trac, isot) RESULT(lerr) 948 957 TYPE(trac_type), ALLOCATABLE, TARGET, INTENT(INOUT) :: trac(:) 949 958 TYPE(isot_type), ALLOCATABLE, TARGET, INTENT(INOUT) :: isot(:) … … 955 964 TYPE(trac_type), POINTER :: t(:), t1 956 965 TYPE(isot_type), POINTER :: i 966 lerr = .FALSE. 957 967 958 968 t => trac … … 1019 1029 !=== READ PHYSICAL PARAMETERS FROM "isotopes_params.def" FILE 1020 1030 ! DONE HERE, AND NOT ONLY IN "infotrac_phy", BECAUSE SOME PHYSICAL PARAMS ARE NEEDED FOR RESTARTS (tnat AND alpha_ideal) 1021 IF(readIsotopesFile('isotopes_params.def',isot)) CALL abort_gcm(modname,'Problem when reading isotopes parameters',1)1022 1023 END SUBROUTINEinitIsotopes1031 lerr = readIsotopesFile('isotopes_params.def',isot) 1032 1033 END FUNCTION initIsotopes 1024 1034 !============================================================================================================================== 1025 1035 … … 1046 1056 END DO 1047 1057 END DO 1048 IF(test(fmsg('Problem with the table content', modname, dispTable(prf, ttl, val, cat([(it,it=1,nt)]), rFmt='(EN8.4)',&1049 sub=modname)), lerr)) RETURN1058 IF(test(fmsg('Problem with the table content', modname, dispTable(prf, ttl, val, & 1059 cat([(it,it=1,nt)]), rFmt='(EN8.4)', nColMax=maxTableWidth, nHead=2, sub=modname)), lerr)) RETURN 1050 1060 DEALLOCATE(ttl, val) 1051 1061 END DO
Note: See TracChangeset
for help on using the changeset viewer.