Changeset 4143 for LMDZ6/trunk/libf/dyn3d
- Timestamp:
- May 9, 2022, 12:35:40 PM (3 years ago)
- Location:
- LMDZ6/trunk/libf/dyn3d
- Files:
-
- 6 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/trunk/libf/dyn3d/advtrac.F90
r4064 r4143 11 11 ! M.A Filiberti (04/2002) 12 12 ! 13 USE infotrac, ONLY: nqtot, tracers, ok_iso_verif13 USE infotrac, ONLY: nqtot, tracers, isoCheck 14 14 USE control_mod, ONLY: iapp_tracvl, day_step 15 15 USE comconst_mod, ONLY: dtvr … … 215 215 #endif 216 216 217 IF(ok_iso_verif) THEN 218 WRITE(*,*) 'advtrac 227' 219 CALL check_isotopes_seq(q,ip1jmp1,'advtrac 162') 220 END IF 217 IF(isoCheck) WRITE(*,*) 'advtrac 227' 218 CALL check_isotopes_seq(q,ip1jmp1,'advtrac 162') 221 219 222 220 !------------------------------------------------------------------------- … … 346 344 END DO 347 345 348 IF(ok_iso_verif) then 349 WRITE(*,*) 'advtrac 402' 350 CALL check_isotopes_seq(q,ip1jmp1,'advtrac 397') 351 END IF 346 IF(isoCheck) WRITE(*,*) 'advtrac 402' 347 CALL check_isotopes_seq(q,ip1jmp1,'advtrac 397') 352 348 353 349 !------------------------------------------------------------------------- -
LMDZ6/trunk/libf/dyn3d/check_isotopes.F90
r4142 r4143 1 subroutine check_isotopes_seq(q,ip1jmp1,err_msg) 2 USE infotrac, ONLY: nqtot, nqo, niso, ntraciso, nzone, 3 & use_iso, 4 & iqiso, index_trac,indnum_fn_num, tnat 5 implicit none 1 SUBROUTINE check_isotopes_seq(q, ip1jmp1, err_msg) 2 USE strings_mod, ONLY: maxlen, msg, strIdx, strStack, int2str, real2str 3 USE infotrac, ONLY: nqtot, niso, nphas, isotope, isoCheck, iqIsoPha, isoSelect, & 4 ntiso, iH2O, nzone, tracers, isoName, itZonIso, tnat 5 IMPLICIT NONE 6 include "dimensions.h" 7 REAL, INTENT(INOUT) :: q(ip1jmp1,llm,nqtot) 8 INTEGER, INTENT(IN) :: ip1jmp1 9 CHARACTER(LEN=*), INTENT(IN) :: err_msg !--- Error message to display 10 CHARACTER(LEN=maxlen) :: modname, msg1, nm(2) 11 INTEGER :: ixt, ipha, k, i, iq, iiso, izon, ieau, iqeau, iqpar 12 INTEGER, ALLOCATABLE :: ix(:) 13 REAL :: xtractot, xiiso, deltaD, q1, q2 14 REAL, PARAMETER :: borne = 1e19, & 15 errmax = 1e-8, & !--- Max. absolute error 16 errmaxrel = 1e-3, & !--- Max. relative error 17 qmin = 1e-11, & 18 deltaDmax =1000.0, & 19 deltaDmin =-999.0, & 20 ridicule = 1e-12 21 INTEGER, SAVE :: iso_eau, iso_HDO, iso_O18, & 22 iso_O17, iso_HTO 23 LOGICAL, SAVE :: first=.TRUE. 6 24 7 #include "dimensions.h" 25 modname='check_isotopes' 26 IF(.NOT.isoCheck) RETURN !--- No need to check => finished 27 IF(isoSelect('H2O')) RETURN !--- No H2O isotopes group found 28 IF(niso == 0) RETURN !--- No isotopes => finished 29 IF(first) THEN 30 iso_eau = strIdx(isoName,'H2[16]O') 31 iso_HDO = strIdx(isoName,'H[2]HO') 32 iso_O18 = strIdx(isoName,'H2[18]O') 33 iso_O17 = strIdx(isoName,'H2[17]O') 34 iso_HTO = strIdx(isoName,'H[3]HO') 35 first = .FALSE. 36 END IF 37 CALL msg('31: err_msg='//TRIM(err_msg), modname) 8 38 9 ! inputs 10 integer ip1jmp1 11 real q(ip1jmp1,llm,nqtot) 12 character*(*) err_msg ! message d''erreur à afficher 39 !--- CHECK FOR NaNs (FOR ALL THE ISOTOPES, INCLUDING GEOGRAPHIC TAGGING TRACERS) 40 modname = 'check_isotopes:iso_verif_noNaN' 41 DO ixt = 1, ntiso 42 DO ipha = 1, nphas 43 iq = iqIsoPha(ixt,ipha) 44 DO k = 1, llm 45 DO i = 1, ip1jmp1 46 IF(ABS(q(i,k,iq)) < borne) CYCLE 47 WRITE(msg1,'(s,"(",i0,",",i0,",",i0,") = ",ES12.4)')TRIM(isoName(ixt)),i,k,iq,q(i,k,iq) 48 CALL msg(msg1, modname) 49 CALL abort_gcm(modname, 'Error with isotopes: '//TRIM(err_msg), 1) 50 END DO 51 END DO 52 END DO 53 END DO 13 54 14 ! locals 15 integer ixt,phase,k,i,iq,iiso,izone,ieau,iqeau 16 real xtractot,xiiso 17 real borne 18 real qmin 19 real errmax ! erreur maximale en absolu. 20 real errmaxrel ! erreur maximale en relatif autorisée 21 real deltaDmax,deltaDmin 22 real ridicule 23 parameter (borne=1e19) 24 parameter (errmax=1e-8) 25 parameter (errmaxrel=1e-3) 26 parameter (qmin=1e-11) 27 parameter (deltaDmax=1000.0,deltaDmin=-999.0) 28 parameter (ridicule=1e-12) 29 real deltaD 55 !--- CHECK CONSERVATION (MAIN ISOTOPE AND PARENT CONCENTRATIONS MUST BE EQUAL) 56 modname = 'check_isotopes:iso_verif_egalite' 57 ixt = iso_eau 58 IF(ixt /= 0) THEN 59 DO ipha = 1, nphas 60 iq = iqIsoPha(ixt,ipha) 61 iqpar = tracers(iq)%iqParent 62 DO k = 1, llm 63 DO i = 1, ip1jmp1 64 q1 = q(i,k,iqpar) 65 q2 = q(i,k,iq) 66 !--- IMPROVEMENT in case at least one isotope is not negligible compared to the main isotopic form. 67 ! This would be probably required to sum from smallest to highest concentrations ; the corresponding 68 ! indices vector can be computed once only (in the initializations stage), using mean concentrations. 69 ! q2 = SUM(q(i,k,tracers(iqPar)%iqDesc), DIM=3) 70 IF(ABS(q1-q2) <= errmax .OR. ABS(q1-q2)/MAX(MAX(ABS(q1),ABS(q2)),1e-18) <= errmaxrel) THEN 71 q(i,k,iq) = q1 !--- Bidouille pour convergence 72 ! q(i,k,tracers(iqPar)%iqDesc) = q(i,k,tracers(iqPar)%iqDesc) * q1 / q2 73 CYCLE 74 END IF 75 CALL msg('ixt, iq = '//TRIM(strStack(int2str([ixt,iq]))), modname) 76 msg1 = '('//TRIM(strStack(int2str([i,k])))//')' 77 CALL msg(TRIM(tracers(iqpar)%name)//TRIM(msg1)//' = '//TRIM(real2str(q1)), modname) 78 CALL msg(TRIM(tracers(iq )%name)//TRIM(msg1)//' = '//TRIM(real2str(q2)), modname) 79 CALL abort_gcm(modname, 'Error with isotopes: '//TRIM(err_msg), 1) 80 END DO 81 END DO 82 END DO 83 END IF 30 84 31 if (niso > 0) then 85 !--- CHECK DELTA ANOMALIES 86 modname = 'check_isotopes:iso_verif_aberrant' 87 ix = [ iso_HDO , iso_O18 ] 88 nm = ['deltaD ', 'deltaO18'] 89 DO iiso = 1, SIZE(ix) 90 ixt = ix(iiso) 91 IF(ixt == 0) CYCLE 92 DO ipha = 1, nphas 93 iq = iqIsoPha(ixt,ipha) 94 iqpar = tracers(iq)%iqParent 95 DO k = 1, llm 96 DO i = 1, ip1jmp1 97 q1 = q(i,k,iqpar) 98 q2 = q(i,k,iq) 99 !--- IMPROVEMENT in case at least one isotope is not negligible compared to the main isotopic form. 100 ! This would be probably required to sum from smallest to highest concentrations ; the corresponding 101 ! indices vector can be computed once only (in the initializations stage), using mean concentrations. 102 ! q2 = SUM(q(i,k,tracers(iqPar)%iqDesc), DIM=3) 103 IF(q2 <= qmin) CYCLE 104 deltaD = (q2/q1/tnat(ixt)-1.)*1000. 105 IF(deltaD <= deltaDmax .AND. deltaD >= deltaDmin) CYCLE 106 CALL msg('ixt, iq = '//TRIM(strStack(int2str([ixt,iq]))), modname) 107 msg1 = '('//TRIM(strStack(int2str([i,k])))//')' 108 CALL msg(TRIM(tracers(iqpar)%name)//TRIM(msg1)//' = '//TRIM(real2str(q1)), modname) 109 CALL msg(TRIM(tracers(iq )%name)//TRIM(msg1)//' = '//TRIM(real2str(q2)), modname) 110 CALL msg(TRIM(nm(iiso))//TRIM(real2str(deltaD)), modname) 111 CALL abort_gcm(modname, 'Error with isotopes: '//TRIM(err_msg), 1) 112 END DO 113 END DO 114 END DO 115 END DO 32 116 33 write(*,*) 'check_isotopes 31: err_msg=',err_msg 34 ! verifier que rien n'est NaN 35 do ixt=1,ntraciso 36 do phase=1,nqo 37 iq=iqiso(ixt,phase) 38 do k=1,llm 39 DO i = 1,ip1jmp1 40 if ((q(i,k,iq).gt.-borne).and. 41 : (q(i,k,iq).lt.borne)) then 42 else !if ((x(ixt,i,j).gt.-borne).and. 43 write(*,*) 'erreur detectee par iso_verif_noNaN:' 44 write(*,*) err_msg 45 write(*,*) 'q,i,k,iq=',q(i,k,iq),i,k,iq 46 write(*,*) 'borne=',borne 47 call abort_gcm('check_isotopes_loc','plantage iso',0) 48 endif !if ((x(ixt,i,j).gt.-borne).and. 49 enddo !DO i = 1,ip1jmp1 50 enddo !do k=1,llm 51 enddo !do phase=1,nqo 52 enddo !do ixt=1,ntraciso 117 IF(nzone == 0) RETURN 53 118 54 !write(*,*) 'check_isotopes 52' 55 ! verifier que l'eau normale est OK 56 if (use_iso(1)) then 57 ixt=indnum_fn_num(1) 58 do phase=1,nqo 59 iq=iqiso(ixt,phase) 60 do k=1,llm 61 DO i = 1,ip1jmp1 62 if ((abs(q(i,k,phase)-q(i,k,iq)).gt.errmax).and. 63 : (abs((q(i,k,phase)-q(i,k,iq))/ 64 : max(max(abs(q(i,k,phase)),abs(q(i,k,iq))),1e-18)) 65 : .gt.errmaxrel)) then 66 write(*,*) 'erreur detectee par iso_verif_egalite:' 67 write(*,*) err_msg 68 write(*,*) 'ixt,phase=',ixt,phase 69 write(*,*) 'q,iq,i,k=',q(i,k,iq),iq,i,k 70 write(*,*) 'q(i,k,phase)=',q(i,k,phase) 71 call abort_gcm('check_isotopes_loc','plantage iso',0) 72 endif !if ((abs(q(i,k,phase)-q(i,k,iq)).gt.errmax).and. 73 ! bidouille pour éviter divergence: 74 q(i,k,iq)= q(i,k,phase) 75 enddo ! DO i = 1,ip1jmp1 76 enddo !do k=1,llm 77 enddo ! do phase=1,nqo 78 endif !if (use_iso(1)) then 79 80 !write(*,*) 'check_isotopes 78' 81 ! verifier que HDO est raisonable 82 if (use_iso(2)) then 83 ixt=indnum_fn_num(2) 84 do phase=1,nqo 85 iq=iqiso(ixt,phase) 86 do k=1,llm 87 DO i = 1,ip1jmp1 88 if (q(i,k,iq).gt.qmin) then 89 deltaD=(q(i,k,iq)/q(i,k,phase)/tnat(2)-1)*1000 90 if ((deltaD.gt.deltaDmax).or.(deltaD.lt.deltaDmin)) then 91 write(*,*) 'erreur detectee par iso_verif_aberrant:' 92 write(*,*) err_msg 93 write(*,*) 'ixt,phase=',ixt,phase 94 write(*,*) 'q,iq,i,k,=',q(i,k,iq),iq,i,k 95 write(*,*) 'q=',q(i,k,:) 96 write(*,*) 'deltaD=',deltaD 97 call abort_gcm('check_isotopes_loc','plantage iso',0) 98 endif !if ((deltaD.gt.deltaDmax).or.(deltaD.lt.deltaDmin)) then 99 endif !if (q(i,k,iq).gt.qmin) then 100 enddo !DO i = 1,ip1jmp1 101 enddo !do k=1,llm 102 enddo ! do phase=1,nqo 103 endif !if (use_iso(2)) then 119 !--- CHECK FOR TAGGING TRACERS DELTAD ANOMALIES 120 modname = 'check_isotopes:iso_verif_aberrant' 121 IF(iso_eau /= 0 .AND. iso_HDO /= 0) THEN 122 DO izon = 1, nzone 123 ixt = itZonIso(izon, iso_HDO) 124 ieau = itZonIso(izon, iso_eau) 125 DO ipha = 1, nphas 126 iq = iqIsoPha(ixt, ipha) 127 iqeau = iqIsoPha(ieau, ipha) 128 DO k = 1, llm 129 DO i = 1, ip1jmp1 130 q1 = q(i,k,iqeau) 131 q2 = q(i,k,iq) 132 IF(q2<=qmin) CYCLE 133 deltaD = (q2/q1/tnat(iso_HDO)-1.)*1000. 134 IF(deltaD <= deltaDmax .AND. deltaD >= deltaDmin) CYCLE 135 CALL msg('izon, ipha = '//TRIM(strStack(int2str([izon, ipha]))), modname) 136 CALL msg( 'ixt, ieau = '//TRIM(strStack(int2str([ ixt, ieau]))), modname) 137 msg1 = '('//TRIM(strStack(int2str([i,k])))//')' 138 CALL msg(TRIM(tracers(iqeau)%name)//TRIM(msg1)//' = '//TRIM(real2str(q1)), modname) 139 CALL msg(TRIM(tracers(iq )%name)//TRIM(msg1)//' = '//TRIM(real2str(q2)), modname) 140 CALL msg('deltaD = '//TRIM(real2str(deltaD)), modname) 141 CALL abort_gcm(modname, 'Error with isotopes: '//TRIM(err_msg), 1) 142 END DO 143 END DO 144 END DO 145 END DO 146 END IF 104 147 105 !write(*,*) 'check_isotopes 103' 106 ! verifier que O18 est raisonable 107 if (use_iso(3)) then 108 ixt=indnum_fn_num(3) 109 do phase=1,nqo 110 iq=iqiso(ixt,phase) 111 do k=1,llm 112 DO i = 1,ip1jmp1 113 if (q(i,k,iq).gt.qmin) then 114 deltaD=(q(i,k,iq)/q(i,k,phase)/tnat(3)-1)*1000 115 if ((deltaD.gt.deltaDmax).or.(deltaD.lt.deltaDmin)) then 116 write(*,*) 'erreur detectee iso_verif_aberrant O18:' 117 write(*,*) err_msg 118 write(*,*) 'ixt,phase=',ixt,phase 119 write(*,*) 'q,iq,i,k,=',q(i,k,phase),iq,i,k 120 write(*,*) 'xt=',q(i,k,:) 121 write(*,*) 'deltaO18=',deltaD 122 call abort_gcm('check_isotopes_loc','plantage iso',0) 123 endif !if ((deltaD.gt.deltaDmax).or.(deltaD.lt.deltaDmin)) then 124 endif !if (q(i,k,iq).gt.qmin) then 125 enddo !DO i = 1,ip1jmp1 126 enddo !do k=1,llm 127 enddo ! do phase=1,nqo 128 endif !if (use_iso(2)) then 148 !--- CHECK FOR TAGGING TRACERS CONSERVATION (PARENT AND TAGGING TRACERS SUM OVER ALL REGIONS MUST BE EQUAL) 149 DO iiso = 1, niso 150 DO ipha = 1, nphas 151 iq = iqIsoPha(iiso, ipha) 152 DO k = 1, llm 153 DO i = 1, ip1jmp1 154 xiiso = q(i,k,iq) 155 xtractot = SUM(q(i, k, iqIsoPha(itZonIso(1:nzone,iiso), ipha))) 156 IF(ABS(xtractot-xiiso) > errmax .AND. ABS(xtractot-xiiso)/MAX(MAX(ABS(xtractot),ABS(xiiso)),1e-18) > errmaxrel) THEN 157 CALL msg('Error in iso_verif_aberrant trac: '//TRIM(err_msg)) 158 CALL msg('iiso, ipha = '//TRIM(strStack(int2str([iiso, ipha]))), modname) 159 CALL msg('q('//TRIM(strStack(int2str([i,k])))//',:) = '//TRIM(strStack(real2str(q(i,k,:)))), modname) 160 CALL abort_gcm(modname, 'Error with isotopes: '//TRIM(err_msg), 1) 161 END IF 162 IF(ABS(xtractot) <= ridicule) CYCLE 163 DO izon = 1, nzone 164 q(i,k,iq) = q(i,k,iq) / xtractot * xiiso !--- Bidouille pour convergence 165 END DO 166 END DO 167 END DO 168 END DO 169 END DO 129 170 171 END SUBROUTINE check_isotopes_seq 130 172 131 !write(*,*) 'check_isotopes 129'132 if (nzone > 0) then133 134 if (use_iso(2).and.use_iso(1)) then135 do izone=1,nzone136 ixt=index_trac(izone,indnum_fn_num(2))137 ieau=index_trac(izone,indnum_fn_num(1))138 do phase=1,nqo139 iq=iqiso(ixt,phase)140 iqeau=iqiso(ieau,phase)141 do k=1,llm142 DO i = 1,ip1jmp1143 if (q(i,k,iq).gt.qmin) then144 deltaD=(q(i,k,iq)/q(i,k,iqeau)/tnat(2)-1)*1000145 if ((deltaD.gt.deltaDmax).or.146 & (deltaD.lt.deltaDmin)) then147 write(*,*) 'erreur dans iso_verif_aberrant trac:'148 write(*,*) err_msg149 write(*,*) 'izone,phase=',izone,phase150 write(*,*) 'ixt,ieau=',ixt,ieau151 write(*,*) 'q,iq,i,k,=',q(i,k,iq),iq,i,k152 write(*,*) 'deltaD=',deltaD153 call abort_gcm('check_isotopes_loc','plantage iso',0)154 endif !if ((deltaD.gt.deltaDmax).or.155 endif !if (q(i,k,iq).gt.qmin) then156 enddo !DO i = 1,ip1jmp1157 enddo ! do k=1,llm158 enddo ! do phase=1,nqo159 enddo !do izone=1,nzone160 endif !if (use_iso(2).and.use_iso(1)) then161 162 do iiso=1,niso163 do phase=1,nqo164 iq=iqiso(iiso,phase)165 do k=1,llm166 DO i = 1,ip1jmp1167 xtractot=0.0168 xiiso=q(i,k,iq)169 do izone=1,nzone170 iq=iqiso(index_trac(izone,iiso),phase)171 xtractot=xtractot+ q(i,k,iq)172 enddo !do izone=1,ntraceurs_zone173 if ((abs(xtractot-xiiso).gt.errmax).and.174 : (abs(xtractot-xiiso)/175 : max(max(abs(xtractot),abs(xiiso)),1e-18)176 : .gt.errmaxrel)) then177 write(*,*) 'erreur detectee par iso_verif_traceurs:'178 write(*,*) err_msg179 write(*,*) 'iiso,phase=',iiso,phase180 write(*,*) 'i,k,=',i,k181 write(*,*) 'q(i,k,:)=',q(i,k,:)182 call abort_gcm('check_isotopes_loc','plantage iso',0)183 endif !if ((abs(q(i,k,phase)-q(i,k,iq)).gt.errmax).and.184 185 ! bidouille pour éviter divergence:186 if (abs(xtractot).gt.ridicule) then187 do izone=1,nzone188 ixt=index_trac(izone,iiso)189 q(i,k,iq)=q(i,k,iq)/xtractot*xiiso190 enddo !do izone=1,nzone191 endif !if ((abs(xtractot).gt.ridicule) then192 enddo !DO i = 1,ip1jmp1193 enddo !do k=1,llm194 enddo !do phase=1,nqo195 enddo !do iiso=1,niso196 197 endif !if (nzone > 0)198 199 endif ! if (niso > 0)200 !write(*,*) 'check_isotopes 198'201 202 end203 -
LMDZ6/trunk/libf/dyn3d/dynetat0.F90
r4124 r4143 6 6 ! Purpose: Initial state reading. 7 7 !------------------------------------------------------------------------------- 8 USE infotrac, ONLY: nqtot, tracers, niso, iq iso, iso_indnum, iso_num, tnat, alpha_ideal, iH2O8 USE infotrac, ONLY: nqtot, tracers, niso, iqIsoPha, tnat, alpha_ideal, iH2O 9 9 USE strings_mod, ONLY: maxlen, msg, strStack, real2str 10 10 USE netcdf, ONLY: NF90_OPEN, NF90_NOWRITE, NF90_INQ_VARID, & … … 145 145 #endif 146 146 ELSE IF(tracers(iq)%iso_iGroup == iH2O .AND. niso > 0) THEN !=== WATER ISOTOPES 147 ! iName = tracers(iq)%iso_iName ! (next commit) 148 iName = iso_num(iq) 147 iName = tracers(iq)%iso_iName 149 148 iPhase = tracers(iq)%iso_iPhase 150 149 iqParent = tracers(iq)%iqParent … … 154 153 ELSE 155 154 CALL msg('Tracer <'//TRIM(var)//'> is missing => initialized to its parent isotope concentration.', modname) 156 q(:,:,:,iq) = q(:,:,:,iq iso(iso_indnum(iq),iPhase))155 q(:,:,:,iq) = q(:,:,:,iqIsoPha(iName,iPhase)) 157 156 END IF 158 157 !-------------------------------------------------------------------------------------------------------------------------- -
LMDZ6/trunk/libf/dyn3d/iniacademic.F90
r4124 r4143 5 5 6 6 USE filtreg_mod, ONLY: inifilr 7 USE infotrac, ONLY: nqtot, niso, niso_possibles, ok_iso_verif, tnat, alpha_ideal, & 8 iqiso, tracers, iso_indnum, iso_num 7 USE infotrac, ONLY: nqtot, niso, tnat, alpha_ideal, iqIsoPha, tracers 9 8 USE control_mod, ONLY: day_step,planet_type 10 9 use exner_hyb_m, only: exner_hyb … … 282 281 ! CRisi: init des isotopes 283 282 ! distill de Rayleigh très simplifiée 284 ! iName = tracers(iq)%iso_iName ! (next commit) 285 iName = iso_num(iq) 283 iName = tracers(iq)%iso_iName 286 284 if (niso <= 0 .OR. iName <= 0) CYCLE 287 285 iPhase = tracers(iq)%iso_iPhase … … 290 288 q(:,:,iq) = q(:,:,iqParent)*tnat(iName)*(q(:,:,iqParent)/30.e-3)**(alpha_ideal(iName)-1.) 291 289 ELSE 292 q(:,:,iq) = q(:,:,iq iso(iso_indnum(iq),iPhase))290 q(:,:,iq) = q(:,:,iqIsoPha(iName,iPhase)) 293 291 END IF 294 292 enddo … … 297 295 endif ! of if (planet_type=="earth") 298 296 299 if (ok_iso_verif)call check_isotopes_seq(q,1,ip1jmp1,'iniacademic_loc')297 call check_isotopes_seq(q,1,ip1jmp1,'iniacademic_loc') 300 298 301 299 ! add random perturbation to temperature -
LMDZ6/trunk/libf/dyn3d/leapfrog.F
r4120 r4143 11 11 use IOIPSL 12 12 #endif 13 USE infotrac, ONLY: nqtot, ok_iso_verif13 USE infotrac, ONLY: nqtot, isoCheck 14 14 USE guide_mod, ONLY : guide_main 15 15 USE write_field, ONLY: writefield … … 26 26 USE temps_mod, ONLY: jD_ref,jH_ref,itaufin,day_ini,day_ref, 27 27 & start_time,dt 28 USE strings_mod, ONLY: msg 28 29 29 30 IMPLICIT NONE … … 237 238 jH_cur = jH_cur - int(jH_cur) 238 239 239 if (ok_iso_verif) then 240 call check_isotopes_seq(q,ip1jmp1,'leapfrog 321') 241 endif !if (ok_iso_verif) then 240 call check_isotopes_seq(q,ip1jmp1,'leapfrog 321') 242 241 243 242 #ifdef CPP_IOIPSL … … 271 270 ! CALL filtreg ( finvmaold ,jjp1, llm, -2,2, .TRUE., 1 ) 272 271 273 if (ok_iso_verif) then 274 call check_isotopes_seq(q,ip1jmp1,'leapfrog 400') 275 endif !if (ok_iso_verif) then 272 call check_isotopes_seq(q,ip1jmp1,'leapfrog 400') 276 273 277 274 2 CONTINUE ! Matsuno backward or leapfrog step begins here … … 324 321 325 322 326 if (ok_iso_verif) then 327 call check_isotopes_seq(q,ip1jmp1,'leapfrog 589') 328 endif !if (ok_iso_verif) then 323 call check_isotopes_seq(q,ip1jmp1,'leapfrog 589') 329 324 330 325 c----------------------------------------------------------------------- … … 345 340 c ------------------------------------------------------------- 346 341 347 if (ok_iso_verif) then 348 call check_isotopes_seq(q,ip1jmp1, 342 call check_isotopes_seq(q,ip1jmp1, 349 343 & 'leapfrog 686: avant caladvtrac') 350 endif !if (ok_iso_verif) then351 344 352 345 IF( forward. OR . leapf ) THEN … … 376 369 c ---------------------------------- 377 370 378 if (ok_iso_verif) then 379 write(*,*) 'leapfrog 720' 380 call check_isotopes_seq(q,ip1jmp1,'leapfrog 756') 381 endif !if (ok_iso_verif) then 371 CALL msg('720', modname, isoCheck) 372 call check_isotopes_seq(q,ip1jmp1,'leapfrog 756') 382 373 383 374 CALL integrd ( nqtot,vcovm1,ucovm1,tetam1,psm1,massem1 , … … 385 376 ! $ finvmaold ) 386 377 387 if (ok_iso_verif) then 388 write(*,*) 'leapfrog 724' 389 call check_isotopes_seq(q,ip1jmp1,'leapfrog 762') 390 endif !if (ok_iso_verif) then 378 CALL msg('724', modname, isoCheck) 379 call check_isotopes_seq(q,ip1jmp1,'leapfrog 762') 391 380 392 381 c .P.Le Van (26/04/94 ajout de finvpold dans l'appel d'integrd) … … 552 541 CALL massdair(p,masse) 553 542 554 if (ok_iso_verif) then 555 call check_isotopes_seq(q,ip1jmp1,'leapfrog 1196') 556 endif !if (ok_iso_verif) then 543 call check_isotopes_seq(q,ip1jmp1,'leapfrog 1196') 557 544 558 545 c----------------------------------------------------------------------- … … 639 626 c preparation du pas d'integration suivant ...... 640 627 641 if (ok_iso_verif) then 642 call check_isotopes_seq(q,ip1jmp1,'leapfrog 1509') 643 endif !if (ok_iso_verif) then 628 call check_isotopes_seq(q,ip1jmp1,'leapfrog 1509') 644 629 645 630 IF ( .NOT.purmats ) THEN … … 703 688 ENDIF ! of IF((MOD(itau,iperiod).EQ.0).OR.(itau.EQ.itaufin)) 704 689 705 if (ok_iso_verif) then 706 call check_isotopes_seq(q,ip1jmp1,'leapfrog 1584') 707 endif !if (ok_iso_verif) then 690 call check_isotopes_seq(q,ip1jmp1,'leapfrog 1584') 708 691 709 692 c----------------------------------------------------------------------- … … 790 773 ELSE ! of IF (.not.purmats) 791 774 792 if (ok_iso_verif) then 793 call check_isotopes_seq(q,ip1jmp1,'leapfrog 1664') 794 endif !if (ok_iso_verif) then 775 call check_isotopes_seq(q,ip1jmp1,'leapfrog 1664') 795 776 796 777 c ........................................................ … … 817 798 ELSE ! of IF(forward) i.e. backward step 818 799 819 if (ok_iso_verif) then 820 call check_isotopes_seq(q,ip1jmp1,'leapfrog 1698') 821 endif !if (ok_iso_verif) then 800 call check_isotopes_seq(q,ip1jmp1,'leapfrog 1698') 822 801 823 802 IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin) THEN -
LMDZ6/trunk/libf/dyn3d/qminimum.F
r4124 r4143 4 4 SUBROUTINE qminimum( q,nqtot,deltap ) 5 5 6 USE infotrac, ONLY: niso, ntraciso,iqiso,ok_iso_verif 6 USE infotrac, ONLY: niso, ntiso,iqIsoPha, tracers 7 USE strings_mod, ONLY: strIdx 8 USE readTracFiles_mod, ONLY: addPhase 7 9 IMPLICIT none 8 10 c … … 16 18 REAL q(ip1jmp1,llm,nqtot), deltap(ip1jmp1,llm) 17 19 c 18 INTEGER iq_vap, iq_liq 19 PARAMETER ( iq_vap = 1 ) ! indice pour l'eau vapeur 20 PARAMETER ( iq_liq = 2 ) ! indice pour l'eau liquide 21 REAL seuil_vap, seuil_liq 22 PARAMETER ( seuil_vap = 1.0e-10 ) ! seuil pour l'eau vapeur 23 PARAMETER ( seuil_liq = 1.0e-11 ) ! seuil pour l'eau liquide 20 LOGICAL, SAVE :: first=.TRUE. 21 INTEGER, SAVE :: iq_vap, iq_liq ! indices pour l'eau vapeur/liquide 22 REAL, PARAMETER :: seuil_vap = 1.0e-10 ! seuil pour l'eau vapeur 23 REAL, PARAMETER :: seuil_liq = 1.0e-11 ! seuil pour l'eau liquide 24 24 c 25 25 c NB. ....( Il est souhaitable mais non obligatoire que les valeurs des … … 43 43 !INTEGER nb_pump 44 44 INTEGER ixt 45 46 IF(first) THEN 47 iq_vap = strIdx(tracers(:)%name, addPhase('H2O', 'g')) 48 iq_liq = strIdx(tracers(:)%name, addPhase('H2O', 'l')) 49 first = .FALSE. 50 END IF 45 51 c 46 52 c Quand l'eau liquide est trop petite (ou negative), on prend … … 49 55 c 50 56 51 if (ok_iso_verif) then 52 call check_isotopes_seq(q,ip1jmp1,'qminimum 52') 53 endif !if (ok_iso_verif) then 57 call check_isotopes_seq(q,ip1jmp1,'qminimum 52') 54 58 55 59 zx_defau_diag(:,:,:)=0.0 … … 127 131 if (zx_defau_diag(i,k,iq_vap).gt.0.0) then 128 132 ! on ajoute la vapeur en k 129 do ixt=1,nt raciso130 q(i,k,iq iso(ixt,iq_vap))=q(i,k,iqiso(ixt,iq_vap))131 : 132 : *q(i,k-1,iqiso(ixt,iq_vap))/q_follow(i,k-1,iq_vap)133 do ixt=1,ntiso 134 q(i,k,iqIsoPha(ixt,iq_vap))=q(i,k,iqIsoPha(ixt,iq_vap)) 135 : +zx_defau_diag(i,k,iq_vap) 136 : *q(i,k-1,iqIsoPha(ixt,iq_vap))/q_follow(i,k-1,iq_vap) 133 137 134 138 ! et on la retranche en k-1 135 q(i,k-1,iqiso(ixt,iq_vap))=q(i,k-1,iqiso(ixt,iq_vap)) 139 q(i,k-1,iqIsoPha(ixt,iq_vap))= 140 : q(i,k-1,iqIsoPha(ixt,iq_vap)) 136 141 : -zx_defau_diag(i,k,iq_vap) 137 142 : *deltap(i,k)/deltap(i,k-1) 138 : *q(i,k-1,iqiso(ixt,iq_vap))/q_follow(i,k-1,iq_vap) 143 : *q(i,k-1,iqIsoPha(ixt,iq_vap)) 144 : /q_follow(i,k-1,iq_vap) 139 145 140 146 enddo !do ixt=1,niso … … 148 154 enddo !do k=2,llm 149 155 150 if (ok_iso_verif) then 151 call check_isotopes_seq(q,ip1jmp1,'qminimum 168') 152 endif !if (ok_iso_verif) then 156 call check_isotopes_seq(q,ip1jmp1,'qminimum 168') 153 157 154 158 … … 160 164 161 165 ! on ajoute eau liquide en k en k 162 do ixt=1,nt raciso163 q(i,k,iq iso(ixt,iq_liq))=q(i,k,iqiso(ixt,iq_liq))166 do ixt=1,ntiso 167 q(i,k,iqIsoPha(ixt,iq_liq))=q(i,k,iqIsoPha(ixt,iq_liq)) 164 168 : +zx_defau_diag(i,k,iq_liq) 165 : *q(i,k,iq iso(ixt,iq_vap))/q_follow(i,k,iq_vap)169 : *q(i,k,iqIsoPha(ixt,iq_vap))/q_follow(i,k,iq_vap) 166 170 ! et on la retranche à la vapeur en k 167 q(i,k,iq iso(ixt,iq_vap))=q(i,k,iqiso(ixt,iq_vap))171 q(i,k,iqIsoPha(ixt,iq_vap))=q(i,k,iqIsoPha(ixt,iq_vap)) 168 172 : -zx_defau_diag(i,k,iq_liq) 169 : *q(i,k,iq iso(ixt,iq_vap))/q_follow(i,k,iq_vap)173 : *q(i,k,iqIsoPha(ixt,iq_vap))/q_follow(i,k,iq_vap) 170 174 enddo !do ixt=1,niso 171 175 q_follow(i,k,iq_liq)= q_follow(i,k,iq_liq) … … 177 181 enddo !do k=2,llm 178 182 179 if (ok_iso_verif) then 180 call check_isotopes_seq(q,ip1jmp1,'qminimum 197') 181 endif !if (ok_iso_verif) then 183 call check_isotopes_seq(q,ip1jmp1,'qminimum 197') 182 184 183 185 endif !if (niso > 0) then -
LMDZ6/trunk/libf/dyn3d/vlsplt.F
r4064 r4143 125 125 RECURSIVE SUBROUTINE vlx(q,pente_max,masse,u_m,iq) 126 126 USE infotrac, ONLY : nqtot,tracers, ! CRisi 127 & qperemin,masseqmin,ratiomin! MVals et CRisi127 & min_qParent,min_qMass,min_ratio ! MVals et CRisi 128 128 129 129 c Auteurs: P.Le Van, F.Hourdin, F.Forget … … 428 428 !Ratio(ij,l,iq2)=q(ij,l,iq2)/q(ij,l,iq) 429 429 !Mvals: veiller a ce qu'on n'ait pas de denominateur nul 430 masseq(ij,l,iq2)=max(masse(ij,l,iq)*q(ij,l,iq),m asseqmin)431 if (q(ij,l,iq).gt. qperemin) then430 masseq(ij,l,iq2)=max(masse(ij,l,iq)*q(ij,l,iq),min_qMass) 431 if (q(ij,l,iq).gt.min_qParent) then 432 432 Ratio(ij,l,iq2)=q(ij,l,iq2)/q(ij,l,iq) 433 433 else 434 Ratio(ij,l,iq2)= ratiomin434 Ratio(ij,l,iq2)=min_ratio 435 435 endif 436 436 enddo … … 449 449 DO ij=iip2+1,ip1jm 450 450 !MVals: veiller a ce qu'on ait pas de denominateur nul 451 new_m=max(masse(ij,l,iq)+u_m(ij-1,l)-u_m(ij,l),m asseqmin)451 new_m=max(masse(ij,l,iq)+u_m(ij-1,l)-u_m(ij,l),min_qMass) 452 452 q(ij,l,iq)=(q(ij,l,iq)*masse(ij,l,iq)+ 453 453 & u_mq(ij-1,l)-u_mq(ij,l)) … … 485 485 RECURSIVE SUBROUTINE vly(q,pente_max,masse,masse_adv_v,iq) 486 486 USE infotrac, ONLY : nqtot,tracers, ! CRisi 487 & qperemin,masseqmin,ratiomin! MVals et CRisi487 & min_qParent,min_qMass,min_ratio ! MVals et CRisi 488 488 c 489 489 c Auteurs: P.Le Van, F.Hourdin, F.Forget … … 752 752 !Ratio(ij,l,iq2)=q(ij,l,iq2)/q(ij,l,iq) 753 753 !MVals: veiller a ce qu'on n'ait pas de denominateur nul 754 masseq(ij,l,iq2)=max(masse(ij,l,iq)*q(ij,l,iq),m asseqmin)755 if (q(ij,l,iq).gt. qperemin) then754 masseq(ij,l,iq2)=max(masse(ij,l,iq)*q(ij,l,iq),min_qMass) 755 if (q(ij,l,iq).gt.min_qParent) then 756 756 Ratio(ij,l,iq2)=q(ij,l,iq2)/q(ij,l,iq) 757 757 else 758 Ratio(ij,l,iq2)= ratiomin758 Ratio(ij,l,iq2)=min_ratio 759 759 endif 760 760 enddo … … 848 848 RECURSIVE SUBROUTINE vlz(q,pente_max,masse,w,iq) 849 849 USE infotrac, ONLY : nqtot,tracers, ! CRisi 850 & qperemin,masseqmin,ratiomin! MVals et CRisi850 & min_qParent,min_qMass,min_ratio ! MVals et CRisi 851 851 c 852 852 c Auteurs: P.Le Van, F.Hourdin, F.Forget … … 977 977 !Ratio(ij,l,iq2)=q(ij,l,iq2)/q(ij,l,iq) 978 978 !MVals: veiller a ce qu'on n'ait pas de denominateur nul 979 masseq(ij,l,iq2)=max(masse(ij,l,iq)*q(ij,l,iq),m asseqmin)980 if (q(ij,l,iq).gt. qperemin) then979 masseq(ij,l,iq2)=max(masse(ij,l,iq)*q(ij,l,iq),min_qMass) 980 if (q(ij,l,iq).gt.min_qParent) then 981 981 Ratio(ij,l,iq2)=q(ij,l,iq2)/q(ij,l,iq) 982 982 else 983 Ratio(ij,l,iq2)= ratiomin983 Ratio(ij,l,iq2)=min_ratio 984 984 endif 985 985 enddo
Note: See TracChangeset
for help on using the changeset viewer.