Changeset 5185 for LMDZ6/branches/Amaury_dev
- Timestamp:
- Sep 11, 2024, 4:27:07 PM (4 months ago)
- Location:
- LMDZ6/branches/Amaury_dev/libf
- Files:
-
- 108 edited
- 9 moved
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/Amaury_dev/libf/dyn3d_common/lmdz_infotrac.f90
r5182 r5185 200 200 END IF 201 201 CASE('repr') 202 IF (.NOT. CPPKEY_REPROBUS) 202 IF (.NOT. CPPKEY_REPROBUS) THEN 203 203 CALL abort_gcm(modname, 'You must add cpp key REPROBUS and compile with REPROBUS code', 1) 204 204 END IF -
LMDZ6/branches/Amaury_dev/libf/dyn3dmem/dynetat0_loc.f90
r5184 r5185 1 SUBROUTINE dynetat0_loc(fichnom, vcov,ucov,teta,q,masse,ps,phis,time)2 3 !-------------------------------------------------------------------------------4 ! Authors: P. Le Van , L.Fairhead5 !-------------------------------------------------------------------------------6 ! Purpose: Initial state reading.7 !-------------------------------------------------------------------------------1 SUBROUTINE dynetat0_loc(fichnom, vcov, ucov, teta, q, masse, ps, phis, time) 2 3 !------------------------------------------------------------------------------- 4 ! Authors: P. Le Van , L.Fairhead 5 !------------------------------------------------------------------------------- 6 ! Purpose: Initial state reading. 7 !------------------------------------------------------------------------------- 8 8 USE parallel_lmdz 9 USE lmdz_infotrac, 9 USE lmdz_infotrac, ONLY: nqtot, tracers, niso, iqIsoPha, iH2O, isoName 10 10 USE lmdz_strings, ONLY: maxlen, msg, strStack, real2str, int2str, strIdx 11 USE netcdf, ONLY: nf90_open,nf90_nowrite, nf90_inquire_dimension, nf90_inq_varid, &12 nf90_close, nf90_get_var, nf90_inquire_variable,nf90_noerr11 USE netcdf, ONLY: nf90_open, nf90_nowrite, nf90_inquire_dimension, nf90_inq_varid, & 12 nf90_close, nf90_get_var, nf90_inquire_variable, nf90_noerr 13 13 USE lmdz_readTracFiles, ONLY: new2oldH2O, newHNO3, oldHNO3, getKey 14 14 USE control_mod, ONLY: planet_type 15 15 USE lmdz_assert_eq, ONLY: assert_eq 16 USE comvert_mod, ONLY: pa, preff16 USE comvert_mod, ONLY: pa, preff 17 17 USE comconst_mod, ONLY: cpp, daysec, dtvr, g, im, jm, kappa, lllm, omeg, rad 18 18 USE logic_mod, ONLY: fxyhypb, ysinus 19 19 USE serre_mod, ONLY: clon, clat, grossismx, grossismy 20 20 USE temps_mod, ONLY: annee_ref, day_ini, day_ref, itau_dyn, start_time 21 USE ener_mod, ONLY: etot0, ptot0,ztot0,stot0,ang022 USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA 21 USE ener_mod, ONLY: etot0, ptot0, ztot0, stot0, ang0 22 USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA, CPPKEY_REPROBUS 23 23 USE lmdz_description, ONLY: descript 24 24 USE lmdz_iniprint, ONLY: lunout, prt_level 25 25 USE lmdz_comgeom 26 26 27 USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm27 USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm 28 28 USE lmdz_paramet 29 29 IMPLICIT NONE 30 30 31 31 32 !===============================================================================33 ! Arguments:34 CHARACTER(LEN =*), INTENT(IN) :: fichnom !--- FILE NAME35 REAL, INTENT(OUT) :: vcov(ijb_v:ije_v,llm) !--- V COVARIANT WIND36 REAL, INTENT(OUT) :: ucov(ijb_u:ije_u,llm) !--- U COVARIANT WIND37 REAL, INTENT(OUT) :: teta(ijb_u:ije_u,llm) !--- POTENTIAL TEMP.38 REAL, INTENT(OUT) :: q(ijb_u:ije_u,llm,nqtot)!--- TRACERS39 REAL, INTENT(OUT) :: masse(ijb_u:ije_u, llm) !--- MASS PER CELL40 REAL, INTENT(OUT) :: 41 REAL, INTENT(OUT) :: 42 !===============================================================================43 ! Local variables:44 CHARACTER(LEN =maxlen) :: mesg, var, modname, oldVar45 INTEGER, PARAMETER :: length =10032 !=============================================================================== 33 ! Arguments: 34 CHARACTER(LEN = *), INTENT(IN) :: fichnom !--- FILE NAME 35 REAL, INTENT(OUT) :: vcov(ijb_v:ije_v, llm) !--- V COVARIANT WIND 36 REAL, INTENT(OUT) :: ucov(ijb_u:ije_u, llm) !--- U COVARIANT WIND 37 REAL, INTENT(OUT) :: teta(ijb_u:ije_u, llm) !--- POTENTIAL TEMP. 38 REAL, INTENT(OUT) :: q(ijb_u:ije_u, llm, nqtot)!--- TRACERS 39 REAL, INTENT(OUT) :: masse(ijb_u:ije_u, llm) !--- MASS PER CELL 40 REAL, INTENT(OUT) :: ps(ijb_u:ije_u) !--- GROUND PRESSURE 41 REAL, INTENT(OUT) :: phis(ijb_u:ije_u) !--- GEOPOTENTIAL 42 !=============================================================================== 43 ! Local variables: 44 CHARACTER(LEN = maxlen) :: mesg, var, modname, oldVar 45 INTEGER, PARAMETER :: length = 100 46 46 INTEGER :: iq, fID, vID, idecal, ierr, iqParent, iName, iZone, iPhase, ix 47 REAL :: time,tab_cntrl(length) !--- RUN PARAMS TABLE48 REAL 49 REAL, ALLOCATABLE :: vcov_glo(:,:),masse_glo(:,:),ps_glo(:)50 REAL, ALLOCATABLE :: ucov_glo(:,:), q_glo(:,:), phis_glo(:)51 REAL, ALLOCATABLE :: teta_glo(:,:)47 REAL :: time, tab_cntrl(length) !--- RUN PARAMS TABLE 48 REAL :: tnat, alpha_ideal 49 REAL, ALLOCATABLE :: vcov_glo(:, :), masse_glo(:, :), ps_glo(:) 50 REAL, ALLOCATABLE :: ucov_glo(:, :), q_glo(:, :), phis_glo(:) 51 REAL, ALLOCATABLE :: teta_glo(:, :) 52 52 LOGICAL :: lSkip, ll 53 LOGICAL, PARAMETER :: tnat1=.TRUE.54 !-------------------------------------------------------------------------------55 modname ="dynetat0_loc"56 57 !--- Initial state file opening58 var =fichnom59 CALL err(nf90_open(var, nf90_nowrite,fID),"open",var)60 CALL get_var1("controle", tab_cntrl)61 62 !!! AS: idecal is a hack to be able to read planeto starts...63 !!! .... while keeping everything OK for LMDZ EARTH53 LOGICAL, PARAMETER :: tnat1 = .TRUE. 54 !------------------------------------------------------------------------------- 55 modname = "dynetat0_loc" 56 57 !--- Initial state file opening 58 var = fichnom 59 CALL err(nf90_open(var, nf90_nowrite, fID), "open", var) 60 CALL get_var1("controle", tab_cntrl) 61 62 !!! AS: idecal is a hack to be able to read planeto starts... 63 !!! .... while keeping everything OK for LMDZ EARTH 64 64 IF(planet_type=="generic") THEN 65 65 CALL msg('NOTE NOTE NOTE : Planeto-like start files', modname) 66 66 idecal = 4 67 annee_ref 67 annee_ref = 2000 68 68 ELSE 69 69 CALL msg('NOTE NOTE NOTE : Earth-like start files', modname) 70 70 idecal = 5 71 annee_ref 71 annee_ref = tab_cntrl(5) 72 72 END IF 73 im 74 jm 75 lllm 76 day_ref 77 rad = tab_cntrl(idecal+1)78 omeg = tab_cntrl(idecal+2)79 g = tab_cntrl(idecal+3)80 cpp = tab_cntrl(idecal+4)81 kappa = tab_cntrl(idecal+5)82 daysec = tab_cntrl(idecal+6)83 dtvr = tab_cntrl(idecal+7)84 etot0 = tab_cntrl(idecal+8)85 ptot0 = tab_cntrl(idecal+9)86 ztot0 = tab_cntrl(idecal+10)87 stot0 = tab_cntrl(idecal+11)88 ang0 = tab_cntrl(idecal+12)89 pa = tab_cntrl(idecal+13)90 preff = tab_cntrl(idecal+14)91 92 clon = tab_cntrl(idecal+15)93 clat = tab_cntrl(idecal+16)94 grossismx = tab_cntrl(idecal+17)95 grossismy = tab_cntrl(idecal+18)96 97 IF ( tab_cntrl(idecal+19)==1.) THEN98 fxyhypb 99 ! dzoomx = tab_cntrl(25)100 ! dzoomy = tab_cntrl(26)101 ! taux = tab_cntrl(28)102 ! tauy = tab_cntrl(29)73 im = tab_cntrl(1) 74 jm = tab_cntrl(2) 75 lllm = tab_cntrl(3) 76 day_ref = tab_cntrl(4) 77 rad = tab_cntrl(idecal + 1) 78 omeg = tab_cntrl(idecal + 2) 79 g = tab_cntrl(idecal + 3) 80 cpp = tab_cntrl(idecal + 4) 81 kappa = tab_cntrl(idecal + 5) 82 daysec = tab_cntrl(idecal + 6) 83 dtvr = tab_cntrl(idecal + 7) 84 etot0 = tab_cntrl(idecal + 8) 85 ptot0 = tab_cntrl(idecal + 9) 86 ztot0 = tab_cntrl(idecal + 10) 87 stot0 = tab_cntrl(idecal + 11) 88 ang0 = tab_cntrl(idecal + 12) 89 pa = tab_cntrl(idecal + 13) 90 preff = tab_cntrl(idecal + 14) 91 92 clon = tab_cntrl(idecal + 15) 93 clat = tab_cntrl(idecal + 16) 94 grossismx = tab_cntrl(idecal + 17) 95 grossismy = tab_cntrl(idecal + 18) 96 97 IF (tab_cntrl(idecal + 19)==1.) THEN 98 fxyhypb = .TRUE. 99 ! dzoomx = tab_cntrl(25) 100 ! dzoomy = tab_cntrl(26) 101 ! taux = tab_cntrl(28) 102 ! tauy = tab_cntrl(29) 103 103 ELSE 104 104 fxyhypb = .FALSE. 105 ysinus = tab_cntrl(idecal+22)==1.105 ysinus = tab_cntrl(idecal + 22)==1. 106 106 END IF 107 107 108 day_ini 109 itau_dyn 108 day_ini = tab_cntrl(30) 109 itau_dyn = tab_cntrl(31) 110 110 start_time = tab_cntrl(32) 111 111 112 !-------------------------------------------------------------------------------113 CALL msg('rad, omeg, g, cpp, kappa = ' //TRIM(strStack(real2str([rad,omeg,g,cpp,kappa]))), modname)114 CALL check_dim(im, iim,'im','im')115 CALL check_dim(jm, jjm,'jm','jm')116 CALL check_dim(lllm, llm,'lm','lllm')117 CALL get_var1("rlonu", rlonu)118 CALL get_var1("rlatu", rlatu)119 CALL get_var1("rlonv", rlonv)120 CALL get_var1("rlatv", rlatv)121 CALL get_var1("cu" ,cu)122 CALL get_var1("cv" ,cv)123 CALL get_var1("aire", aire)124 125 var ="temps"126 IF(nf90_inq_varid(fID, var,vID)/=nf90_noerr) THEN112 !------------------------------------------------------------------------------- 113 CALL msg('rad, omeg, g, cpp, kappa = ' // TRIM(strStack(real2str([rad, omeg, g, cpp, kappa]))), modname) 114 CALL check_dim(im, iim, 'im', 'im') 115 CALL check_dim(jm, jjm, 'jm', 'jm') 116 CALL check_dim(lllm, llm, 'lm', 'lllm') 117 CALL get_var1("rlonu", rlonu) 118 CALL get_var1("rlatu", rlatu) 119 CALL get_var1("rlonv", rlonv) 120 CALL get_var1("rlatv", rlatv) 121 CALL get_var1("cu", cu) 122 CALL get_var1("cv", cv) 123 CALL get_var1("aire", aire) 124 125 var = "temps" 126 IF(nf90_inq_varid(fID, var, vID)/=nf90_noerr) THEN 127 127 CALL msg('missing field <temps> ; trying with <Time>', modname) 128 var ="Time"129 CALL err(nf90_inq_varid(fID, var,vID),"inq",var)128 var = "Time" 129 CALL err(nf90_inq_varid(fID, var, vID), "inq", var) 130 130 END IF 131 CALL err(nf90_get_var(fID, vID,time),"get",var)131 CALL err(nf90_get_var(fID, vID, time), "get", var) 132 132 133 133 ALLOCATE(phis_glo(ip1jmp1)) 134 CALL get_var1("phisinit", phis_glo)135 phis (ijb_u:ije_u) =phis_glo(ijb_u:ije_u); DEALLOCATE(phis_glo)136 137 ALLOCATE(ucov_glo(ip1jmp1, llm))138 CALL get_var2("ucov", ucov_glo)139 ucov (ijb_u:ije_u, :)=ucov_glo(ijb_u:ije_u,:); DEALLOCATE(ucov_glo)140 141 ALLOCATE(vcov_glo(ip1jm, llm))142 CALL get_var2("vcov", vcov_glo)143 vcov (ijb_v:ije_v, :)=vcov_glo(ijb_v:ije_v,:); DEALLOCATE(vcov_glo)144 145 ALLOCATE(teta_glo(ip1jmp1, llm))146 CALL get_var2("teta", teta_glo)147 teta (ijb_u:ije_u, :)=teta_glo(ijb_u:ije_u,:); DEALLOCATE(teta_glo)148 149 ALLOCATE(masse_glo(ip1jmp1, llm))150 CALL get_var2("masse", masse_glo)151 masse(ijb_u:ije_u, :)=masse_glo(ijb_u:ije_u,:); DEALLOCATE(masse_glo)152 134 CALL get_var1("phisinit", phis_glo) 135 phis (ijb_u:ije_u) = phis_glo(ijb_u:ije_u); DEALLOCATE(phis_glo) 136 137 ALLOCATE(ucov_glo(ip1jmp1, llm)) 138 CALL get_var2("ucov", ucov_glo) 139 ucov (ijb_u:ije_u, :) = ucov_glo(ijb_u:ije_u, :); DEALLOCATE(ucov_glo) 140 141 ALLOCATE(vcov_glo(ip1jm, llm)) 142 CALL get_var2("vcov", vcov_glo) 143 vcov (ijb_v:ije_v, :) = vcov_glo(ijb_v:ije_v, :); DEALLOCATE(vcov_glo) 144 145 ALLOCATE(teta_glo(ip1jmp1, llm)) 146 CALL get_var2("teta", teta_glo) 147 teta (ijb_u:ije_u, :) = teta_glo(ijb_u:ije_u, :); DEALLOCATE(teta_glo) 148 149 ALLOCATE(masse_glo(ip1jmp1, llm)) 150 CALL get_var2("masse", masse_glo) 151 masse(ijb_u:ije_u, :) = masse_glo(ijb_u:ije_u, :); DEALLOCATE(masse_glo) 152 153 153 ALLOCATE(ps_glo(ip1jmp1)) 154 CALL get_var1("ps", ps_glo)155 ps (ijb_u:ije_u) =ps_glo(ijb_u:ije_u); DEALLOCATE(ps_glo)156 157 !--- Tracers158 ALLOCATE(q_glo(ip1jmp1, llm))154 CALL get_var1("ps", ps_glo) 155 ps (ijb_u:ije_u) = ps_glo(ijb_u:ije_u); DEALLOCATE(ps_glo) 156 157 !--- Tracers 158 ALLOCATE(q_glo(ip1jmp1, llm)) 159 159 ll = .FALSE. 160 #ifdef REPROBUS 161 ll = nf90_inq_varid(fID, 'HNO3tot', vID) /= nf90_noerr !--- DETECT OLD REPRO start.nc FILE162 #endif 163 DO iq =1,nqtot160 IF (CPPKEY_REPROBUS) THEN 161 ll = nf90_inq_varid(fID, 'HNO3tot', vID) /= nf90_noerr !--- DETECT OLD REPRO start.nc FILE 162 END IF 163 DO iq = 1, nqtot 164 164 var = tracers(iq)%name 165 165 oldVar = new2oldH2O(var) 166 166 lSkip = ll .AND. var == 'HNO3' !--- FORCE "HNO3_g" READING FOR "HNO3" 167 #ifdef REPROBUS 168 ix = strIdx(newHNO3, var); IF(ix /= 0) oldVar = oldHNO3(ix) !--- REPROBUS HNO3 exceptions169 #endif 167 IF (CPPKEY_REPROBUS) THEN 168 ix = strIdx(newHNO3, var); IF(ix /= 0) oldVar = oldHNO3(ix) !--- REPROBUS HNO3 exceptions 169 END IF 170 170 IF (CPPKEY_INCA) THEN 171 171 IF(var == 'O3') oldVar = 'OX' !--- DEAL WITH INCA OZONE EXCEPTION … … 173 173 !-------------------------------------------------------------------------------------------------------------------------- 174 174 IF(nf90_inq_varid(fID, var, vID) == nf90_noerr .AND. .NOT.lSkip) THEN !=== REGULAR CASE: AVAILABLE VARIABLE 175 CALL get_var2(var, q_glo); q(ijb_u:ije_u,:,iq)=q_glo(ijb_u:ije_u,:)176 !--------------------------------------------------------------------------------------------------------------------------175 CALL get_var2(var, q_glo); q(ijb_u:ije_u, :, iq) = q_glo(ijb_u:ije_u, :) 176 !-------------------------------------------------------------------------------------------------------------------------- 177 177 ELSE IF(nf90_inq_varid(fID, oldVar, vID) == nf90_noerr) THEN !=== TRY WITH ALTERNATE NAME 178 CALL msg('Tracer <' //TRIM(var)//'> is missing => initialized to <'//TRIM(oldVar)//'>', modname)179 CALL get_var2(oldVar, q_glo); q(ijb_u:ije_u, :,iq)=q_glo(ijb_u:ije_u,:)180 !--------------------------------------------------------------------------------------------------------------------------178 CALL msg('Tracer <' // TRIM(var) // '> is missing => initialized to <' // TRIM(oldVar) // '>', modname) 179 CALL get_var2(oldVar, q_glo); q(ijb_u:ije_u, :, iq) = q_glo(ijb_u:ije_u, :) 180 !-------------------------------------------------------------------------------------------------------------------------- 181 181 ELSE IF(tracers(iq)%iso_iGroup == iH2O .AND. niso > 0) THEN !=== WATER ISOTOPES 182 iName 183 iPhase 182 iName = tracers(iq)%iso_iName 183 iPhase = tracers(iq)%iso_iPhase 184 184 iqParent = tracers(iq)%iqParent 185 185 IF(tracers(iq)%iso_iZone == 0) THEN 186 187 tnat=1.0188 alpha_ideal=1.0189 WRITE(*,*) 'attention dans dynetat0: les alpha_ideal sont a 1'190 186 IF (tnat1) THEN 187 tnat = 1.0 188 alpha_ideal = 1.0 189 WRITE(*, *) 'attention dans dynetat0: les alpha_ideal sont a 1' 190 else 191 191 IF(getKey('tnat', tnat, isoName(iName)) .OR. getKey('alpha', alpha_ideal, isoName(iName))) & 192 CALL abort_gcm(TRIM(modname), 'missing isotopic parameters', 1)193 194 CALL msg('Tracer <'//TRIM(var)//'> is missing => initialized with a simplified Rayleigh distillation law.', modname)195 q(ijb_u:ije_u,:,iq) = q(ijb_u:ije_u,:,iqParent)*tnat*(q(ijb_u:ije_u,:,iqParent)/30.e-3)**(alpha_ideal-1.)196 197 192 CALL abort_gcm(TRIM(modname), 'missing isotopic parameters', 1) 193 endif 194 CALL msg('Tracer <' // TRIM(var) // '> is missing => initialized with a simplified Rayleigh distillation law.', modname) 195 q(ijb_u:ije_u, :, iq) = q(ijb_u:ije_u, :, iqParent) * tnat * (q(ijb_u:ije_u, :, iqParent) / 30.e-3)**(alpha_ideal - 1.) 196 ! Camille 9 mars 2023: point de vigilence: initialisation incohérente 197 ! avec celle de xt_ancien dans la physiq. 198 198 ELSE 199 CALL msg('Tracer <'//TRIM(var)//'> is missing => initialized to its parent isotope concentration.', modname)200 201 202 203 204 205 206 q(ijb_u:ije_u,:,iq) = q(ijb_u:ije_u,:,iqIsoPha(iName,iPhase))207 208 q(ijb_u:ije_u,:,iq) =0.209 199 CALL msg('Tracer <' // TRIM(var) // '> is missing => initialized to its parent isotope concentration.', modname) 200 ! Camille 9 mars 2023: attention!! seuls les tags qui correspondent à 201 ! izone=izone_init (définie dans isotrac_mod) sont initialisés comme 202 ! les parents. Sinon, c'est nul. 203 ! j'ai fait ça en attendant, mais il faudrait initialiser proprement en 204 ! remplacant 1 par izone_init dans la ligne qui suit. 205 IF(tracers(iq)%iso_iZone == 1) THEN 206 q(ijb_u:ije_u, :, iq) = q(ijb_u:ije_u, :, iqIsoPha(iName, iPhase)) 207 ELSE 208 q(ijb_u:ije_u, :, iq) = 0. 209 ENDIF 210 210 END IF 211 !--------------------------------------------------------------------------------------------------------------------------211 !-------------------------------------------------------------------------------------------------------------------------- 212 212 ELSE !=== MISSING: SET TO 0 213 CALL msg('Tracer <' //TRIM(var)//'> is missing => initialized to zero', modname)214 q(ijb_u:ije_u, :,iq)=0.215 !--------------------------------------------------------------------------------------------------------------------------213 CALL msg('Tracer <' // TRIM(var) // '> is missing => initialized to zero', modname) 214 q(ijb_u:ije_u, :, iq) = 0. 215 !-------------------------------------------------------------------------------------------------------------------------- 216 216 END IF 217 217 END DO 218 218 DEALLOCATE(q_glo) 219 CALL err(nf90_close(fID),"close",fichnom) 220 day_ini=day_ini+INT(time) 221 time=time-INT(time) 222 223 224 CONTAINS 225 226 227 SUBROUTINE check_dim(n1,n2,str1,str2) 228 INTEGER, INTENT(IN) :: n1, n2 229 CHARACTER(LEN=*), INTENT(IN) :: str1, str2 230 CHARACTER(LEN=maxlen) :: s1, s2 231 IF(n1/=n2) CALL abort_gcm(TRIM(modname), 'value of "'//TRIM(str1)//'" = '//TRIM(int2str(n1))// & 232 ' read in starting file differs from gcm value of "'//TRIM(str2)//'" = '//TRIM(int2str(n2)), 1) 233 END SUBROUTINE check_dim 234 235 236 SUBROUTINE get_var1(var,v) 237 CHARACTER(LEN=*), INTENT(IN) :: var 238 REAL, INTENT(OUT) :: v(:) 239 REAL, ALLOCATABLE :: w2(:,:), w3(:,:,:) 240 INTEGER :: nn(3), dids(3), k, nd, ntot 241 242 CALL err(nf90_inq_varid(fID,var,vID),"inq",var) 243 ierr=nf90_inquire_variable(fID,vID,ndims=nd) 244 IF(nd==1) THEN 245 CALL err(nf90_get_var(fID,vID,v),"get",var); RETURN 246 END IF 247 ierr=nf90_inquire_variable(fID,vID,dimids=dids) 248 DO k=1,nd; ierr=nf90_inquire_dimension(fID,dids(k),len=nn(k)); END DO 249 ntot=PRODUCT(nn(1:nd)) 250 SELECT CASE(nd) 251 CASE(2); ALLOCATE(w2(nn(1),nn(2))) 252 CALL err(nf90_get_var(fID,vID,w2),"get",var) 253 v=RESHAPE(w2,[ntot]); DEALLOCATE(w2) 254 CASE(3); ALLOCATE(w3(nn(1),nn(2),nn(3))) 255 CALL err(nf90_get_var(fID,vID,w3),"get",var) 256 v=RESHAPE(w3,[ntot]); DEALLOCATE(w3) 257 END SELECT 258 END SUBROUTINE get_var1 259 260 SUBROUTINE get_var2(var,v) 261 CHARACTER(LEN=*), INTENT(IN) :: var 262 REAL, INTENT(OUT) :: v(:,:) 263 REAL, ALLOCATABLE :: w4(:,:,:,:), w3(:,:,:) 264 INTEGER :: nn(4), dids(4), k, nd 265 266 267 CALL err(nf90_inq_varid(fID,var,vID),"inq",var) 268 ierr=nf90_inquire_variable(fID,vID,ndims=nd) 269 270 IF(nd==1) THEN 271 CALL err(nf90_get_var(fID,vID,v),"get",var); RETURN 272 END IF 273 ierr=nf90_inquire_variable(fID,vID,dimids=dids) 274 275 DO k=1,nd; ierr=nf90_inquire_dimension(fID,dids(k),len=nn(k)); END DO 276 277 SELECT CASE(nd) 278 CASE(3); ALLOCATE(w3(nn(1),nn(2),nn(3))) 279 CALL err(nf90_get_var(fID,vID,w3),"get",var) 280 v=RESHAPE(w3,[nn(1)*nn(2),nn(3)]); DEALLOCATE(w3) 281 CASE(4); ALLOCATE(w4(nn(1),nn(2),nn(3),nn(4))) 282 CALL err(nf90_get_var(fID,vID,w4),"get",var) 283 v=RESHAPE(w4,[nn(1)*nn(2),nn(3)]); DEALLOCATE(w4) 284 END SELECT 285 END SUBROUTINE get_var2 286 287 288 SUBROUTINE err(ierr,typ,nam) 289 INTEGER, INTENT(IN) :: ierr !--- NetCDF ERROR CODE 290 CHARACTER(LEN=*), INTENT(IN) :: typ !--- TYPE OF OPERATION 291 CHARACTER(LEN=*), INTENT(IN) :: nam !--- FIELD/FILE NAME 292 IF(ierr==nf90_noerr) RETURN 293 SELECT CASE(typ) 294 CASE('inq'); mesg="Field <"//TRIM(nam)//"> is missing" 295 CASE('get'); mesg="Reading failed for <"//TRIM(nam)//">" 296 CASE('open'); mesg="File opening failed for <"//TRIM(nam)//">" 297 CASE('close'); mesg="File closing failed for <"//TRIM(nam)//">" 298 END SELECT 299 CALL ABORT_gcm(TRIM(modname),TRIM(mesg),ierr) 300 END SUBROUTINE err 219 CALL err(nf90_close(fID), "close", fichnom) 220 day_ini = day_ini + INT(time) 221 time = time - INT(time) 222 223 224 CONTAINS 225 226 227 SUBROUTINE check_dim(n1, n2, str1, str2) 228 INTEGER, INTENT(IN) :: n1, n2 229 CHARACTER(LEN = *), INTENT(IN) :: str1, str2 230 CHARACTER(LEN = maxlen) :: s1, s2 231 IF(n1/=n2) CALL abort_gcm(TRIM(modname), 'value of "' // TRIM(str1) // '" = ' // TRIM(int2str(n1)) // & 232 ' read in starting file differs from gcm value of "' // TRIM(str2) // '" = ' // TRIM(int2str(n2)), 1) 233 END SUBROUTINE check_dim 234 235 236 SUBROUTINE get_var1(var, v) 237 CHARACTER(LEN = *), INTENT(IN) :: var 238 REAL, INTENT(OUT) :: v(:) 239 REAL, ALLOCATABLE :: w2(:, :), w3(:, :, :) 240 INTEGER :: nn(3), dids(3), k, nd, ntot 241 242 CALL err(nf90_inq_varid(fID, var, vID), "inq", var) 243 ierr = nf90_inquire_variable(fID, vID, ndims = nd) 244 IF(nd==1) THEN 245 CALL err(nf90_get_var(fID, vID, v), "get", var); RETURN 246 END IF 247 ierr = nf90_inquire_variable(fID, vID, dimids = dids) 248 DO k = 1, nd; ierr = nf90_inquire_dimension(fID, dids(k), len = nn(k)); 249 END DO 250 ntot = PRODUCT(nn(1:nd)) 251 SELECT CASE(nd) 252 CASE(2); ALLOCATE(w2(nn(1), nn(2))) 253 CALL err(nf90_get_var(fID, vID, w2), "get", var) 254 v = RESHAPE(w2, [ntot]); DEALLOCATE(w2) 255 CASE(3); ALLOCATE(w3(nn(1), nn(2), nn(3))) 256 CALL err(nf90_get_var(fID, vID, w3), "get", var) 257 v = RESHAPE(w3, [ntot]); DEALLOCATE(w3) 258 END SELECT 259 END SUBROUTINE get_var1 260 261 SUBROUTINE get_var2(var, v) 262 CHARACTER(LEN = *), INTENT(IN) :: var 263 REAL, INTENT(OUT) :: v(:, :) 264 REAL, ALLOCATABLE :: w4(:, :, :, :), w3(:, :, :) 265 INTEGER :: nn(4), dids(4), k, nd 266 267 CALL err(nf90_inq_varid(fID, var, vID), "inq", var) 268 ierr = nf90_inquire_variable(fID, vID, ndims = nd) 269 270 IF(nd==1) THEN 271 CALL err(nf90_get_var(fID, vID, v), "get", var); RETURN 272 END IF 273 ierr = nf90_inquire_variable(fID, vID, dimids = dids) 274 275 DO k = 1, nd; ierr = nf90_inquire_dimension(fID, dids(k), len = nn(k)); 276 END DO 277 278 SELECT CASE(nd) 279 CASE(3); ALLOCATE(w3(nn(1), nn(2), nn(3))) 280 CALL err(nf90_get_var(fID, vID, w3), "get", var) 281 v = RESHAPE(w3, [nn(1) * nn(2), nn(3)]); DEALLOCATE(w3) 282 CASE(4); ALLOCATE(w4(nn(1), nn(2), nn(3), nn(4))) 283 CALL err(nf90_get_var(fID, vID, w4), "get", var) 284 v = RESHAPE(w4, [nn(1) * nn(2), nn(3)]); DEALLOCATE(w4) 285 END SELECT 286 END SUBROUTINE get_var2 287 288 289 SUBROUTINE err(ierr, typ, nam) 290 INTEGER, INTENT(IN) :: ierr !--- NetCDF ERROR CODE 291 CHARACTER(LEN = *), INTENT(IN) :: typ !--- TYPE OF OPERATION 292 CHARACTER(LEN = *), INTENT(IN) :: nam !--- FIELD/FILE NAME 293 IF(ierr==nf90_noerr) RETURN 294 SELECT CASE(typ) 295 CASE('inq'); mesg = "Field <" // TRIM(nam) // "> is missing" 296 CASE('get'); mesg = "Reading failed for <" // TRIM(nam) // ">" 297 CASE('open'); mesg = "File opening failed for <" // TRIM(nam) // ">" 298 CASE('close'); mesg = "File closing failed for <" // TRIM(nam) // ">" 299 END SELECT 300 CALL ABORT_gcm(TRIM(modname), TRIM(mesg), ierr) 301 END SUBROUTINE err 301 302 302 303 END SUBROUTINE dynetat0_loc -
LMDZ6/branches/Amaury_dev/libf/dyn3dmem/leapfrog_loc.f90
r5184 r5185 39 39 xios_set_current_context, & 40 40 using_xios 41 USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_DEBUGIO 41 USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_DEBUGIO, CPPKEY_REPROBUS 42 42 USE lmdz_description, ONLY: descript 43 43 USE lmdz_iniprint, ONLY: lunout, prt_level … … 81 81 ! Declarations: 82 82 ! ------------- 83 84 85 86 83 87 84 REAL, INTENT(IN) :: time_0 ! not used … … 319 316 320 317 IF (ok_guide) THEN 321 CALL guide_main(itau, ucov,vcov,teta,q,masse,ps)322 !$OMP BARRIER318 CALL guide_main(itau, ucov, vcov, teta, q, masse, ps) 319 !$OMP BARRIER 323 320 ENDIF 324 321 … … 796 793 !c$OMP END PARALLEL 797 794 798 799 800 795 IF(apphys) THEN 801 796 … … 952 947 endif 953 948 954 IF (ANY(type_trac == ['inca', 'inco'])) THEN 955 CALL finalize_inca 956 ! switching back to LMDZDYN context 957 !$OMP MASTER 958 IF (ok_dyn_xios) THEN 959 CALL xios_set_current_context(dyn3d_ctx_handle) 960 ENDIF 961 !$OMP END MASTER 949 IF (ANY(type_trac == ['inca', 'inco'])) THEN 950 CALL finalize_inca 951 ! switching back to LMDZDYN context 952 !$OMP MASTER 953 IF (ok_dyn_xios) THEN 954 CALL xios_set_current_context(dyn3d_ctx_handle) 962 955 ENDIF 963 #ifdef REPROBUS 964 IF (type_trac == 'repr') CALL finalize_reprobus 965 #endif 956 !$OMP END MASTER 957 ENDIF 958 IF (CPPKEY_REPROBUS) THEN 959 IF (type_trac == 'repr') CALL finalize_reprobus 960 END IF 966 961 967 962 !$OMP MASTER … … 1005 1000 !$OMP END MASTER 1006 1001 1007 IF (ANY(type_trac == ['inca', 'inco'])) THEN 1008 CALL finalize_inca 1009 ! switching back to LMDZDYN context 1010 !$OMP MASTER 1011 IF (ok_dyn_xios) THEN 1012 CALL xios_set_current_context(dyn3d_ctx_handle) 1013 ENDIF 1014 !$OMP END MASTER 1002 IF (ANY(type_trac == ['inca', 'inco'])) THEN 1003 CALL finalize_inca 1004 ! switching back to LMDZDYN context 1005 !$OMP MASTER 1006 IF (ok_dyn_xios) THEN 1007 CALL xios_set_current_context(dyn3d_ctx_handle) 1015 1008 ENDIF 1016 #ifdef REPROBUS 1017 IF (type_trac == 'repr') CALL finalize_reprobus 1018 #endif 1009 !$OMP END MASTER 1010 ENDIF 1011 IF (CPPKEY_REPROBUS) THEN 1012 IF (type_trac == 'repr') CALL finalize_reprobus 1013 END IF 1019 1014 1020 1015 !$OMP MASTER … … 1044 1039 !$OMP BARRIER 1045 1040 1046 1047 1048 CALL bilan_dyn_loc(2,dtvr*iperiod,dtvr*day_step*periodav, &1049 ps, masse,pk,pbaru,pbarv,teta,phi,ucov,vcov,q)1050 1051 1052 1053 1054 CALL writedynav_loc(itau,vcov, &1055 ucov,teta,pk,phi,q,masse,ps,phis)1056 1041 IF (ok_dynzon) THEN 1042 1043 CALL bilan_dyn_loc(2, dtvr * iperiod, dtvr * day_step * periodav, & 1044 ps, masse, pk, pbaru, pbarv, teta, phi, ucov, vcov, q) 1045 1046 ENDIF !ok_dynzon 1047 1048 IF (ok_dyn_ave) THEN 1049 CALL writedynav_loc(itau, vcov, & 1050 ucov, teta, pk, phi, q, masse, ps, phis) 1051 ENDIF 1057 1052 1058 1053 ENDIF … … 1073 1068 !$OMP BARRIER 1074 1069 1075 1076 CALL writehist_loc(itau,vcov,ucov,teta,pk,phi,q, &1077 masse,ps,phis)1078 1070 IF (ok_dyn_ins) THEN 1071 CALL writehist_loc(itau, vcov, ucov, teta, pk, phi, q, & 1072 masse, ps, phis) 1073 endif 1079 1074 1080 1075 IF (ok_dyn_xios) THEN … … 1167 1162 !$OMP END MASTER 1168 1163 1169 IF (ANY(type_trac == ['inca', 'inco'])) THEN 1170 CALL finalize_inca 1171 ! switching back to LMDZDYN context 1172 !$OMP MASTER 1173 IF (ok_dyn_xios) THEN 1174 CALL xios_set_current_context(dyn3d_ctx_handle) 1175 ENDIF 1176 !$OMP END MASTER 1164 IF (ANY(type_trac == ['inca', 'inco'])) THEN 1165 CALL finalize_inca 1166 ! switching back to LMDZDYN context 1167 !$OMP MASTER 1168 IF (ok_dyn_xios) THEN 1169 CALL xios_set_current_context(dyn3d_ctx_handle) 1177 1170 ENDIF 1178 #ifdef REPROBUS 1179 IF (type_trac == 'repr') CALL finalize_reprobus 1180 #endif 1171 !$OMP END MASTER 1172 ENDIF 1173 IF (CPPKEY_REPROBUS) THEN 1174 IF (type_trac == 'repr') CALL finalize_reprobus 1175 END IF 1181 1176 1182 1177 !$OMP MASTER … … 1200 1195 ENDIF 1201 1196 1202 ! Ehouarn: re-compute geopotential for outputs 1203 !$OMP BARRIER 1204 !$OMP MASTER 1205 CALL geopot_loc(ip1jmp1,teta,pk,pks,phis,phi) 1206 !$OMP END MASTER 1207 !$OMP BARRIER 1208 1209 IF (ok_dynzon) THEN 1210 CALL bilan_dyn_loc(2,dtvr*iperiod,dtvr*day_step*periodav, & 1211 ps,masse,pk,pbaru,pbarv,teta,phi,ucov,vcov,q) 1212 ENDIF 1213 1214 IF (ok_dyn_ave) THEN 1215 CALL writedynav_loc(itau,vcov, & 1216 ucov,teta,pk,phi,q,masse,ps,phis) 1217 ENDIF 1218 1219 ENDIF ! of IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin) 1220 1221 IF(MOD(itau, iecri)==0) THEN 1222 1197 ! Ehouarn: re-compute geopotential for outputs 1223 1198 !$OMP BARRIER 1224 1199 !$OMP MASTER … … 1227 1202 !$OMP BARRIER 1228 1203 1229 1230 IF (ok_dyn_ins) THEN 1231 CALL writehist_loc(itau,vcov,ucov,teta,pk,phi,q, & 1232 masse,ps,phis) 1233 endif ! of if (ok_dyn_ins) 1204 IF (ok_dynzon) THEN 1205 CALL bilan_dyn_loc(2, dtvr * iperiod, dtvr * day_step * periodav, & 1206 ps, masse, pk, pbaru, pbarv, teta, phi, ucov, vcov, q) 1207 ENDIF 1208 1209 IF (ok_dyn_ave) THEN 1210 CALL writedynav_loc(itau, vcov, & 1211 ucov, teta, pk, phi, q, masse, ps, phis) 1212 ENDIF 1213 1214 ENDIF ! of IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin) 1215 1216 IF(MOD(itau, iecri)==0) THEN 1217 1218 !$OMP BARRIER 1219 !$OMP MASTER 1220 CALL geopot_loc(ip1jmp1, teta, pk, pks, phis, phi) 1221 !$OMP END MASTER 1222 !$OMP BARRIER 1223 1224 IF (ok_dyn_ins) THEN 1225 CALL writehist_loc(itau, vcov, ucov, teta, pk, phi, q, & 1226 masse, ps, phis) 1227 endif ! of if (ok_dyn_ins) 1234 1228 1235 1229 IF (ok_dyn_xios) THEN … … 1269 1263 !$OMP END MASTER 1270 1264 1271 IF (ANY(type_trac == ['inca', 'inco'])) THEN 1272 CALL finalize_inca 1273 ! switching back to LMDZDYN context 1274 !$OMP MASTER 1275 IF (ok_dyn_xios) THEN 1276 CALL xios_set_current_context(dyn3d_ctx_handle) 1277 ENDIF 1278 !$OMP END MASTER 1265 IF (ANY(type_trac == ['inca', 'inco'])) THEN 1266 CALL finalize_inca 1267 ! switching back to LMDZDYN context 1268 !$OMP MASTER 1269 IF (ok_dyn_xios) THEN 1270 CALL xios_set_current_context(dyn3d_ctx_handle) 1279 1271 ENDIF 1280 #ifdef REPROBUS 1281 IF (type_trac == 'repr') CALL finalize_reprobus 1282 #endif 1272 !$OMP END MASTER 1273 ENDIF 1274 IF (CPPKEY_REPROBUS) THEN 1275 IF (type_trac == 'repr') CALL finalize_reprobus 1276 END IF 1283 1277 1284 1278 !$OMP MASTER -
LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/iniphysiq_mod.F90
r5182 r5185 17 17 USE lmdz_infotrac, ONLY: nbtr, type_trac 18 18 19 #ifdef REPROBUS 20 USE CHEM_REP, ONLY: Init_chem_rep_phys 19 USE lmdz_reprobus_wrappers, ONLY: Init_chem_rep_phys 21 20 #ifdef CPP_PARA 22 21 USE parallel_lmdz, ONLY: mpi_size, mpi_rank 23 22 USE bands, ONLY: distrib_phys 24 23 #endif 25 USE lmdz_phys_omp_data, ONLY: klon_omp 26 #endif 24 USE lmdz_phys_omp_data, ONLY: klon_omp 27 25 USE control_mod, ONLY: dayref, anneeref, day_step, nday, offline, iphysiq 28 26 USE inifis_mod, ONLY: inifis … … 44 42 USE lmdz_comgeom 45 43 USE lmdz_tracstoke 44 USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_REPROBUS 46 45 47 USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm48 USE lmdz_paramet46 USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm 47 USE lmdz_paramet 49 48 IMPLICIT NONE 50 49 … … 53 52 ! geometrical arrays for the physics 54 53 ! ======================================================================= 55 56 57 58 54 59 55 REAL, INTENT (IN) :: prad ! radius of the planet (m) … … 137 133 ! Initializations for Reprobus 138 134 IF (type_trac == 'repr') THEN 139 #ifdef REPROBUS 140 CALL Init_chem_rep_phys(klon_omp,nlayer)141 CALL init_reprobus_para(&142 nbp_lon,nbp_lat,nbp_lev,klon_glo,mpi_size, &143 distrib_phys,communicator)144 #endif 135 IF (CPPKEY_REPROBUS) THEN 136 CALL Init_chem_rep_phys(klon_omp, nlayer) 137 CALL init_reprobus_para(& 138 nbp_lon, nbp_lat, nbp_lev, klon_glo, mpi_size, & 139 distrib_phys, communicator) 140 END IF 145 141 ENDIF 146 142 !$OMP END PARALLEL 147 143 148 144 IF (type_trac == 'repr') THEN 149 #ifdef REPROBUS 150 CALL init_reprobus_para(&151 nbp_lon,nbp_lat,nbp_lev,klon_glo,mpi_size, &152 distrib_phys,communicator)153 #endif 145 IF (CPPKEY_REPROBUS) THEN 146 CALL init_reprobus_para(& 147 nbp_lon, nbp_lat, nbp_lev, klon_glo, mpi_size, & 148 distrib_phys, communicator) 149 END IF 154 150 ENDIF 155 151 -
LMDZ6/branches/Amaury_dev/libf/misc/lmdz_reprobus_wrappers.F90
r5182 r5185 4 4 5 5 #ifdef REPROBUS 6 USE CHEM_REP, ONLY: init_chem_rep_trac 6 USE CHEM_REP, ONLY: init_chem_rep_trac, itroprep 7 7 #else 8 9 ! TODO ugly temp solution until we properly wrap the REPROBUS code 10 USE lmdz_dimensions, ONLY: iim, jjm 11 INTEGER :: itroprep(iim), iter, ndimozon 12 REAL :: rsuntime(2), pdt_rep, daynum, solaireTIME, ptrop(iim), ttrop(iim), ztrop(iim), gravit, Z1, & 13 Z2, fac, B 14 REAL, DIMENSION(iim, jjm) :: pdel, d_q_rep, d_ql_rep, d_qi_rep, rch42d, rn2o2d, rcfc112d, rcfc122d 15 LOGICAL :: ok_suntime, ok_rtime2d 8 16 9 17 CONTAINS … … 13 21 END SUBROUTINE lmdz_reprobus_wrapper_abort 14 22 23 ! TODO replace ugly wrappers below with actual signatures from REPROBUS code 24 25 SUBROUTINE init_chem_rep_trac(nbtr, nqo, name) 26 INTEGER :: nbtr, nqo 27 CHARACTER(len = 256) :: name(:) 28 CALL lmdz_reprobus_wrapper_abort 29 END SUBROUTINE init_chem_rep_trac 30 31 SUBROUTINE init_chem_rep_phys(klon, klev) 32 INTEGER :: klon, klev 33 CALL lmdz_reprobus_wrapper_abort 34 END SUBROUTINE init_chem_rep_phys 35 36 SUBROUTINE init_chem_rep_xjour(j) 37 REAL :: j 38 CALL lmdz_reprobus_wrapper_abort 39 END SUBROUTINE init_chem_rep_xjour 40 15 41 #endif 16 42 END MODULE lmdz_reprobus_wrappers -
LMDZ6/branches/Amaury_dev/libf/phy_common/lmdz_physics_distribution.F90
r5117 r5185 13 13 USE dimphy, ONLY: Init_dimphy 14 14 USE infotrac_phy, ONLY: type_trac 15 #ifdef REPROBUS 16 USE CHEM_REP, ONLY: Init_chem_rep_phys 17 #endif 18 USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA 15 USE lmdz_reprobus_wrappers, ONLY: Init_chem_rep_phys 16 USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA, CPPKEY_REPROBUS 19 17 IMPLICIT NONE 20 18 INTEGER, INTENT(IN) :: grid_type … … 35 33 END IF 36 34 37 #ifdef REPROBUS 38 ! Initialization of Reprobus39 IF (type_trac == 'repr') CALL Init_chem_rep_phys(klon_omp,nbp_lev)40 #endif 35 IF (CPPKEY_REPROBUS) THEN 36 ! Initialization of Reprobus 37 IF (type_trac == 'repr') CALL Init_chem_rep_phys(klon_omp, nbp_lev) 38 END IF 41 39 42 40 !$OMP END PARALLEL … … 49 47 ! USE dimphy, ONLY: Init_dimphy 50 48 ! USE infotrac_phy, ONLY: type_trac 51 ! #ifdef REPROBUS52 ! USE CHEM_REP, ONLY: Init_chem_rep_phys53 ! #endif49 !IF (CPPKEY_REPROBUS) THEN 50 ! USE lmdz_reprobus_wrappers, ONLY: Init_chem_rep_phys 51 !END IF 54 52 55 53 ! IMPLICIT NONE … … 67 65 ! CALL Init_dimphy(klon_omp,nbp_lev) 68 66 69 ! #ifdef REPROBUS67 !IF (CPPKEY_REPROBUS) THEN 70 68 !! Initialization of Reprobus 71 69 ! IF (type_trac == 'repr') CALL Init_chem_rep_phys(klon_omp,nbp_lev) 72 70 ! END IF 73 ! #endif71 !END IF 74 72 75 73 !!$OMP END PARALLEL -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/MISR_simulator.F
r5099 r5185 181 181 ! NOW for MISR .. 182 182 ! if there a cloud ... start the counter ... store this height 183 if(thres_crossed_MISR .eq. 0 . and. dtau .gt. 0.) then183 if(thres_crossed_MISR .eq. 0 .AND. dtau .gt. 0.) then 184 184 185 185 ! first encountered a "cloud" … … 188 188 endif 189 189 190 if( thres_crossed_MISR .lt. 99 . and.190 if( thres_crossed_MISR .lt. 99 .AND. 191 191 & thres_crossed_MISR .gt. 0 ) then 192 192 … … 207 207 ! then MISR will like see a top below the top of the current 208 208 ! layer 209 if( dtau.gt.0 . and. (cloud_dtau-dtau) .lt. 1) then209 if( dtau.gt.0 .AND. (cloud_dtau-dtau) .lt. 1) then 210 210 211 211 if(dtau .lt. 1 .or. ilev.eq.1 .or. ilev.eq.nlev) then … … 228 228 229 229 ! check for a distinctive water layer 230 if(dtau .gt. 1 . and. at(j,ilev).gt.273 ) then230 if(dtau .gt. 1 .AND. at(j,ilev).gt.273 ) then 231 231 232 232 ! must be a water cloud ... … … 292 292 do j=2,npoints-1 293 293 294 if(box_MISR_ztop(j-1,1).gt.0 . and.294 if(box_MISR_ztop(j-1,1).gt.0 .AND. 295 295 & box_MISR_ztop(j+1,1).gt.0 ) then 296 296 297 297 if( abs( box_MISR_ztop(j-1,1) - 298 298 & box_MISR_ztop(j+1,1) ) .lt. 500 299 & . and.299 & .AND. 300 300 & box_MISR_ztop(j,1) .lt. 301 301 & box_MISR_ztop(j+1,1) ) then … … 312 312 do ibox=2,ncol-1 313 313 314 if(box_MISR_ztop(1,ibox-1).gt.0 . and.314 if(box_MISR_ztop(1,ibox-1).gt.0 .AND. 315 315 & box_MISR_ztop(1,ibox+1).gt.0 ) then 316 316 317 317 if( abs( box_MISR_ztop(1,ibox-1) - 318 318 & box_MISR_ztop(1,ibox+1) ) .lt. 500 319 & . and.319 & .AND. 320 320 & box_MISR_ztop(1,ibox) .lt. 321 321 & box_MISR_ztop(1,ibox+1) ) then … … 361 361 itau=1 362 362 else if (tau(j,ibox) .ge. isccp_taumin 363 & . and. tau(j,ibox) .lt. 1.3) then363 & .AND. tau(j,ibox) .lt. 1.3) then 364 364 itau=2 365 365 else if (tau(j,ibox) .ge. 1.3 366 & . and. tau(j,ibox) .lt. 3.6) then366 & .AND. tau(j,ibox) .lt. 3.6) then 367 367 itau=3 368 368 else if (tau(j,ibox) .ge. 3.6 369 & . and. tau(j,ibox) .lt. 9.4) then369 & .AND. tau(j,ibox) .lt. 9.4) then 370 370 itau=4 371 371 else if (tau(j,ibox) .ge. 9.4 372 & . and. tau(j,ibox) .lt. 23.) then372 & .AND. tau(j,ibox) .lt. 23.) then 373 373 itau=5 374 374 else if (tau(j,ibox) .ge. 23. 375 & . and. tau(j,ibox) .lt. 60.) then375 & .AND. tau(j,ibox) .lt. 60.) then 376 376 itau=6 377 377 else if (tau(j,ibox) .ge. 60.) then -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/calc_Re.F90
r5160 r5185 63 63 64 64 ! // if density is constant, set equivalent values for apm and bpm 65 if ((rho_c > 0) . and. (apm < 0)) then65 if ((rho_c > 0) .AND. (apm < 0)) then 66 66 apm = (pi/6)*rho_c 67 67 bpm = 3. … … 70 70 ! Exponential is same as modified gamma with vu =1 71 71 ! if Np is specified then we will just treat as modified gamma 72 if(dtype.eq.2 . and. Np>0) then72 if(dtype.eq.2 .AND. Np>0) then 73 73 local_dtype=1; 74 74 local_p3=1; … … 117 117 118 118 119 if( Np.eq.0 . and. p2+1 > 1E-8) then ! use default value for MEAN diameter as first default119 if( Np.eq.0 .AND. p2+1 > 1E-8) then ! use default value for MEAN diameter as first default 120 120 121 121 dm = p2 ! by definition, should have units of microns … … 231 231 232 232 ! get rg ... 233 if( Np.eq.0 . and. (abs(p2+1) > 1E-8) ) then ! use default value of rg233 if( Np.eq.0 .AND. (abs(p2+1) > 1E-8) ) then ! use default value of rg 234 234 235 235 rg = p2 -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/cosp_output_write_mod.F90
r5158 r5185 185 185 DO k=1,PARASOL_NREFL 186 186 DO ip=1, Npoints 187 if (stlidar%cldlayer(ip,4).gt.0.01. and.stlidar%parasolrefl(ip,k).ne.missing_val) then187 if (stlidar%cldlayer(ip,4).gt.0.01.AND.stlidar%parasolrefl(ip,k).ne.missing_val) then 188 188 parasolcrefl(ip,k)=(stlidar%parasolrefl(ip,k)-0.03*(1.-stlidar%cldlayer(ip,4)))/ & 189 189 stlidar%cldlayer(ip,4) … … 240 240 241 241 !!! Sorties combinees Cloudsat et Calipso 242 if (cfg%Llidar_sim . and. cfg%Lradar_sim) then242 if (cfg%Llidar_sim .AND. cfg%Lradar_sim) then 243 243 where(stradar%lidar_only_freq_cloud == R_UNDEF) & 244 244 stradar%lidar_only_freq_cloud = missing_val -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/cosp_read_otputkeys.F90
r5160 r5185 439 439 Ltbrttov = .false. 440 440 endif 441 if ((.not.Lradar_sim). and.(.not.Llidar_sim).and. &442 (.not.Lisccp_sim). and.(.not.Lmisr_sim)) then441 if ((.not.Lradar_sim).AND.(.not.Llidar_sim).AND. & 442 (.not.Lisccp_sim).AND.(.not.Lmisr_sim)) then 443 443 Lfracout = .false. 444 444 Lstats = .false. … … 469 469 470 470 ! Diagnostics that use Radar and Lidar 471 if (((Lclcalipso2).or.(Lcltlidarradar)). and.((Lradar_sim).or.(Llidar_sim))) then471 if (((Lclcalipso2).or.(Lcltlidarradar)).AND.((Lradar_sim).or.(Llidar_sim))) then 472 472 Lclcalipso2 = .true. 473 473 Lcltlidarradar = .true. -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/dsd.F90
r5160 r5185 91 91 92 92 ! // if density is constant, store equivalent values for apm and bpm 93 if ((rho_c > 0) . and. (apm < 0)) then93 if ((rho_c > 0) .AND. (apm < 0)) then 94 94 apm = (pi/6)*rho_c 95 95 bpm = 3. … … 99 99 ! if only Np given then calculate Re 100 100 ! if neigher than use other defaults (p1,p2,p3) following quickbeam documentation 101 if(Re==0 . and. Np>0) then101 if(Re==0 .AND. Np>0) then 102 102 103 103 call calc_Re(Q,Np,rho_a, & … … 270 270 if (tc < -30) then 271 271 bhp = -1.75+0.09*((tc+273)-243.16) 272 elseif ((tc >= -30) . and. (tc < -9)) then272 elseif ((tc >= -30) .AND. (tc < -9)) then 273 273 bhp = -3.25-0.06*((tc+273)-265.66) 274 274 else … … 280 280 if (tc < -35) then 281 281 bhp = -1.75+0.09*((tc+273)-243.16) 282 elseif ((tc >= -35) . and. (tc < -17.5)) then282 elseif ((tc >= -35) .AND. (tc < -17.5)) then 283 283 bhp = -2.65+0.09*((tc+273)-255.66) 284 elseif ((tc >= -17.5) . and. (tc < -9)) then284 elseif ((tc >= -17.5) .AND. (tc < -9)) then 285 285 bhp = -3.25-0.06*((tc+273)-265.66) 286 286 else -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/format_input.F90
r5158 r5185 114 114 ! :: space-based: heights must be descending 115 115 if ( & 116 (sfc_radar == 1 . and. hgt_descending) .or. &117 (sfc_radar == 0 . and. (.not. hgt_descending)) &116 (sfc_radar == 1 .AND. hgt_descending) .or. & 117 (sfc_radar == 0 .AND. (.not. hgt_descending)) & 118 118 ) & 119 119 then -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/icarus.F
r5099 r5185 364 364 do 12 ilev=1,nlev 365 365 do j=1,npoints 366 if (pfull(j,ilev) .lt. 40000. . and.367 & pfull(j,ilev) .gt. 5000. . and.366 if (pfull(j,ilev) .lt. 40000. .AND. 367 & pfull(j,ilev) .gt. 5000. .AND. 368 368 & at(j,ilev) .lt. attropmin(j)) then 369 369 ptrop(j) = pfull(j,ilev) … … 377 377 do 13 ilev=1,nlev 378 378 do j=1,npoints 379 if (at(j,ilev) .gt. atmax(j) . and.379 if (at(j,ilev) .gt. atmax(j) .AND. 380 380 & ilev .ge. itrop(j)) atmax(j)=at(j,ilev) 381 381 enddo … … 811 811 if (top_height .eq. 1) then 812 812 do j=1,npoints 813 if (transmax(j) .gt. 0.001 . and.813 if (transmax(j) .gt. 0.001 .AND. 814 814 & transmax(j) .le. 0.9999999) then 815 815 fluxtopinit(j) = fluxtop(j,ibox) … … 820 820 do j=1,npoints 821 821 if (tau(j,ibox) .gt. (tauchk )) then 822 if (transmax(j) .gt. 0.001 . and.822 if (transmax(j) .gt. 0.001 .AND. 823 823 & transmax(j) .le. 0.9999999) then 824 824 emcld(j,ibox) = 1. - exp(-1. * tauir(j) ) … … 845 845 !at this point in the code 846 846 tb(j,ibox)= 1307.27/ (log(1. + (1./fluxtop(j,ibox)))) 847 if (top_height.eq.1. and.tauir(j).lt.taumin(j)) then847 if (top_height.eq.1.AND.tauir(j).lt.taumin(j)) then 848 848 tb(j,ibox) = attrop(j) - 5. 849 849 tau(j,ibox) = 2.13*taumin(j) … … 930 930 do j=1,npoints 931 931 if (ilev .ge. itrop(j)) then 932 if ((at(j,ilev) .ge. tb(j,ibox) . and.932 if ((at(j,ilev) .ge. tb(j,ibox) .AND. 933 933 & at(j,ilev+1) .le. tb(j,ibox)) .or. 934 & (at(j,ilev) .le. tb(j,ibox) . and.934 & (at(j,ilev) .le. tb(j,ibox) .AND. 935 935 & at(j,ilev+1) .ge. tb(j,ibox))) then 936 936 nmatch(j)=nmatch(j)+1 … … 976 976 do j=1,npoints 977 977 if ((ptop(j,ibox) .eq. 0. ) 978 & . and.(frac_out(j,ibox,ilev) .ne. 0)) then978 & .AND.(frac_out(j,ibox,ilev) .ne. 0)) then 979 979 ptop(j,ibox)=phalf(j,ilev) 980 980 levmatch(j,ibox)=ilev … … 1048 1048 1049 1049 if (tau(j,ibox) .gt. (tauchk ) 1050 & . and. ptop(j,ibox) .gt. 0.) then1050 & .AND. ptop(j,ibox) .gt. 0.) then 1051 1051 box_cloudy(j,ibox)=.true. 1052 1052 endif … … 1098 1098 else if (tau(j,ibox) .ge. isccp_taumin 1099 1099 & 1100 & . and. tau(j,ibox) .lt. 1.3) then1100 & .AND. tau(j,ibox) .lt. 1.3) then 1101 1101 itau(j)=2 1102 1102 else if (tau(j,ibox) .ge. 1.3 1103 & . and. tau(j,ibox) .lt. 3.6) then1103 & .AND. tau(j,ibox) .lt. 3.6) then 1104 1104 itau(j)=3 1105 1105 else if (tau(j,ibox) .ge. 3.6 1106 & . and. tau(j,ibox) .lt. 9.4) then1106 & .AND. tau(j,ibox) .lt. 9.4) then 1107 1107 itau(j)=4 1108 1108 else if (tau(j,ibox) .ge. 9.4 1109 & . and. tau(j,ibox) .lt. 23.) then1109 & .AND. tau(j,ibox) .lt. 23.) then 1110 1110 itau(j)=5 1111 1111 else if (tau(j,ibox) .ge. 23. 1112 & . and. tau(j,ibox) .lt. 60.) then1112 & .AND. tau(j,ibox) .lt. 60.) then 1113 1113 itau(j)=6 1114 1114 else if (tau(j,ibox) .ge. 60.) then … … 1118 1118 !determine cloud top pressure category 1119 1119 if ( ptop(j,ibox) .gt. 0. 1120 & . and.ptop(j,ibox) .lt. 180.) then1120 & .AND.ptop(j,ibox) .lt. 180.) then 1121 1121 ipres(j)=1 1122 1122 else if(ptop(j,ibox) .ge. 180. 1123 & . and.ptop(j,ibox) .lt. 310.) then1123 & .AND.ptop(j,ibox) .lt. 310.) then 1124 1124 ipres(j)=2 1125 1125 else if(ptop(j,ibox) .ge. 310. 1126 & . and.ptop(j,ibox) .lt. 440.) then1126 & .AND.ptop(j,ibox) .lt. 440.) then 1127 1127 ipres(j)=3 1128 1128 else if(ptop(j,ibox) .ge. 440. 1129 & . and.ptop(j,ibox) .lt. 560.) then1129 & .AND.ptop(j,ibox) .lt. 560.) then 1130 1130 ipres(j)=4 1131 1131 else if(ptop(j,ibox) .ge. 560. 1132 & . and.ptop(j,ibox) .lt. 680.) then1132 & .AND.ptop(j,ibox) .lt. 680.) then 1133 1133 ipres(j)=5 1134 1134 else if(ptop(j,ibox) .ge. 680. 1135 & . and.ptop(j,ibox) .lt. 800.) then1135 & .AND.ptop(j,ibox) .lt. 800.) then 1136 1136 ipres(j)=6 1137 1137 else if(ptop(j,ibox) .ge. 800.) then … … 1140 1140 1141 1141 !update frequencies 1142 if(ipres(j) .gt. 0. and.itau(j) .gt. 0) then1142 if(ipres(j) .gt. 0.AND.itau(j) .gt. 0) then 1143 1143 fq_isccp(j,itau(j),ipres(j))= 1144 1144 & fq_isccp(j,itau(j),ipres(j))+ boxarea -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp.F90
r5160 r5185 139 139 ! and reff_zero == .false. Reff use in lidar and set to 0 for radar 140 140 endif 141 if ((.not. gbx%use_reff) . and. (reff_zero)) then ! No Reff in radar. Default in lidar141 if ((.not. gbx%use_reff) .AND. (reff_zero)) then ! No Reff in radar. Default in lidar 142 142 gbx%Reff = DEFAULT_LIDAR_REFF 143 143 PRINT *, '---------- COSP WARNING ------------' -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_isccp_simulator.F90
r5158 r5185 88 88 89 89 ! Check if there is any value slightly greater than 1 90 where ((y%totalcldarea > 1.0-1.e-5) . and. (y%totalcldarea < 1.0+1.e-5))90 where ((y%totalcldarea > 1.0-1.e-5) .AND. (y%totalcldarea < 1.0+1.e-5)) 91 91 y%totalcldarea = 1.0 92 92 endwhere -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_radar.F90
r5158 r5185 144 144 145 145 if ( & 146 (gbx%surface_radar == 1 . and. hgt_descending) .or. &147 (gbx%surface_radar == 0 . and. (.not. hgt_descending)) &146 (gbx%surface_radar == 1 .AND. hgt_descending) .or. & 147 (gbx%surface_radar == 0 .AND. (.not. hgt_descending)) & 148 148 ) & 149 149 then -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_simulator.F90
r5160 r5185 86 86 ! do j=1,gbx%Nlevels 87 87 ! do i=1,gbx%Npoints 88 ! if ((gbx%mr_hydro(i,j,k)>0.0). and.(gbx%Reff(i,j,k)<=0.0)) inconsistent=.true.88 ! if ((gbx%mr_hydro(i,j,k)>0.0).AND.(gbx%Reff(i,j,k)<=0.0)) inconsistent=.true. 89 89 ! enddo 90 90 ! enddo -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_stats.F90
r5158 r5185 140 140 141 141 !++++++++++++ Lidar-only cloud amount and lidar&radar total cloud mount ++++++++++++++++ 142 if (cfg%Lradar_sim. and.cfg%Llidar_sim) call cosp_lidar_only_cloud(Npoints,Ncolumns,Nlr, &142 if (cfg%Lradar_sim.AND.cfg%Llidar_sim) call cosp_lidar_only_cloud(Npoints,Ncolumns,Nlr, & 143 143 temp_c,betatot_out,betaperptot_out,betamol_c,Ze_out, & 144 144 stradar%lidar_only_freq_cloud,stradar%radar_lidar_tcc) … … 162 162 ,stlidar%parasolrefl,vgrid%z,stlidar%profSR) !OPAQ !TIBO 163 163 !++++++++++++ Lidar-only cloud amount and lidar&radar total cloud mount ++++++++++++++++ 164 if (cfg%Lradar_sim. and.cfg%Llidar_sim) call cosp_lidar_only_cloud(Npoints,Ncolumns,Nlr, &164 if (cfg%Lradar_sim.AND.cfg%Llidar_sim) call cosp_lidar_only_cloud(Npoints,Ncolumns,Nlr, & 165 165 sglidar%temp_tot,sglidar%beta_tot,sglidar%betaperp_tot,sglidar%beta_mol,sgradar%Ze_tot, & 166 166 stradar%lidar_only_freq_cloud,stradar%radar_lidar_tcc) -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_utils.F90
r5160 r5185 85 85 mxratio(i,j,k)=mxratio(i,j,k)/rho 86 86 ! Compute effective radius 87 ! if ((reff(i,j,k) <= 0.0). and.(flux(i,k) /= 0.0)) then88 if ((reff(i,j,k) <= 0.0). and.(flux(i,k) > seuil)) then87 ! if ((reff(i,j,k) <= 0.0).AND.(flux(i,k) /= 0.0)) then 88 if ((reff(i,j,k) <= 0.0).AND.(flux(i,k) > seuil)) then 89 89 lambda_x = (a_x*c_x*((rho0/rho)**g_x)*n_ax*gamma1/flux(i,k))**(1./delta) 90 90 reff(i,j,k) = gamma_4_3_2/lambda_x -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_llnl_stats.F90
r5158 r5185 72 72 if (x(i,k,j) == R_GROUND) then 73 73 cosp_cfad(i,:,j) = R_UNDEF 74 elseif ((x(i,k,j) >= xmin) . and. (x(i,k,j) <= xmax)) then74 elseif ((x(i,k,j) >= xmin) .AND. (x(i,k,j) <= xmax)) then 75 75 ibin = ceiling((x(i,k,j) - bmin)/bwidth) 76 76 if (ibin > Nbins) ibin = Nbins … … 81 81 enddo !k 82 82 enddo !j 83 where ((cosp_cfad /= R_UNDEF). and.(cosp_cfad /= 0.0)) cosp_cfad = cosp_cfad / Ncolumns83 where ((cosp_cfad /= R_UNDEF).AND.(cosp_cfad /= 0.0)) cosp_cfad = cosp_cfad / Ncolumns 84 84 END FUNCTION COSP_CFAD 85 85 … … 117 117 DO j=Nlevels,1,-1 !top->surf 118 118 sc_ratio = beta_tot(pr,i,j)/beta_mol(pr,j) 119 if ((sc_ratio .le. s_att) . and. (flag_sat .eq. 0)) flag_sat = j119 if ((sc_ratio .le. s_att) .AND. (flag_sat .eq. 0)) flag_sat = j 120 120 if (Ze_tot(pr,i,j) .lt. -30.) then !radar can't detect cloud 121 121 if ( (sc_ratio .gt. s_cld) .or. (flag_sat .eq. j) ) then !lidar sense cloud -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_lmd_ipsl_stats.F90
r5160 r5185 146 146 DO ic = 1, ncol 147 147 pnorm_c = pnorm(:,ic,:) 148 where ((pnorm_c.lt.xmax) . and. (pmol.lt.xmax) .and. (pmol.gt. 0.0 ))148 where ((pnorm_c.lt.xmax) .AND. (pmol.lt.xmax) .AND. (pmol.gt. 0.0 )) 149 149 x3d_c = pnorm_c/pmol 150 150 elsewhere … … 273 273 DO i = 1, Npoints 274 274 if (x(i,k,j) /= undef) then 275 if ((x(i,k,j).gt.srbval_ext(ib-1)). and.(x(i,k,j).le.srbval_ext(ib))) &275 if ((x(i,k,j).gt.srbval_ext(ib-1)).AND.(x(i,k,j).le.srbval_ext(ib))) & 276 276 cfad(i,ib,j) = cfad(i,ib,j) + 1.0 277 277 else … … 421 421 422 422 ! cloud detection at subgrid-scale: 423 where ( (x(:,:,k).gt.S_cld) . and. (x(:,:,k).ne. undef) )423 where ( (x(:,:,k).gt.S_cld) .AND. (x(:,:,k).ne. undef) ) 424 424 cldy(:,:,k)=1.0 425 425 elsewhere … … 428 428 429 429 ! number of usefull sub-columns: 430 where ( (x(:,:,k).gt.S_att) . and. (x(:,:,k).ne. undef) )430 where ( (x(:,:,k).gt.S_att) .AND. (x(:,:,k).ne. undef) ) 431 431 srok(:,:,k)=1.0 432 432 elsewhere … … 462 462 ! instead of height, for ice,liquid and all clouds 463 463 DO itemp=1,Ntemp 464 if( (tmp(ip,k).ge.tempmod(itemp)). and.(tmp(ip,k).lt.tempmod(itemp+1)) )then464 if( (tmp(ip,k).ge.tempmod(itemp)).AND.(tmp(ip,k).lt.tempmod(itemp+1)) )then 465 465 lidarcldtempind(ip,itemp)=lidarcldtempind(ip,itemp)+1. 466 466 endif … … 470 470 if (cldy(ip,ic,k).eq.1.) then 471 471 DO itemp=1,Ntemp 472 if( (tmp(ip,k).ge.tempmod(itemp)). and.(tmp(ip,k).lt.tempmod(itemp+1)) )then472 if( (tmp(ip,k).ge.tempmod(itemp)).AND.(tmp(ip,k).lt.tempmod(itemp+1)) )then 473 473 lidarcldtemp(ip,itemp,1)=lidarcldtemp(ip,itemp,1)+1. 474 474 endif … … 478 478 p1 = pplay(ip,k) 479 479 480 if ( p1.gt.0. . and. p1.lt.(440.*100.)) then ! high clouds480 if ( p1.gt.0. .AND. p1.lt.(440.*100.)) then ! high clouds 481 481 cldlay3(ip,ic) = MAX(cldlay3(ip,ic), cldy(ip,ic,k)) 482 482 nsublay3(ip,ic) = MAX(nsublay3(ip,ic), srok(ip,ic,k)) 483 else if(p1.ge.(440.*100.) . and. p1.lt.(680.*100.)) then ! mid clouds483 else if(p1.ge.(440.*100.) .AND. p1.lt.(680.*100.)) then ! mid clouds 484 484 cldlay2(ip,ic) = MAX(cldlay2(ip,ic), cldy(ip,ic,k)) 485 485 nsublay2(ip,ic) = MAX(nsublay2(ip,ic), srok(ip,ic,k)) … … 513 513 if(srok(ip,ic,k).gt.0.)then 514 514 DO itemp=1,Ntemp 515 if( (tmp(ip,k).ge.tempmod(itemp)). and.(tmp(ip,k).lt.tempmod(itemp+1)) )then515 if( (tmp(ip,k).ge.tempmod(itemp)).AND.(tmp(ip,k).lt.tempmod(itemp+1)) )then 516 516 lidarcldtempind(ip,itemp)=lidarcldtempind(ip,itemp)+1. 517 517 endif … … 521 521 if(cldy(ip,ic,k).eq.1.)then 522 522 DO itemp=1,Ntemp 523 if( (tmp(ip,k).ge.tempmod(itemp)). and.(tmp(ip,k).lt.tempmod(itemp+1)) )then523 if( (tmp(ip,k).ge.tempmod(itemp)).AND.(tmp(ip,k).lt.tempmod(itemp+1)) )then 524 524 lidarcldtemp(ip,itemp,1)=lidarcldtemp(ip,itemp,1)+1. 525 525 endif … … 529 529 iz=1 530 530 p1 = pplay(ip,k) 531 if ( p1.gt.0. . and. p1.lt.(440.*100.)) then ! high clouds531 if ( p1.gt.0. .AND. p1.lt.(440.*100.)) then ! high clouds 532 532 iz=3 533 else if(p1.ge.(440.*100.) . and. p1.lt.(680.*100.)) then ! mid clouds533 else if(p1.ge.(440.*100.) .AND. p1.lt.(680.*100.)) then ! mid clouds 534 534 iz=2 535 535 endif … … 590 590 591 591 ! Avoid zero values 592 if( (cldy(i,ncol,nlev).eq.1.) . and. (ATBperp(i,ncol,nlev).gt.0.) )then592 if( (cldy(i,ncol,nlev).eq.1.) .AND. (ATBperp(i,ncol,nlev).gt.0.) )then 593 593 ! Computation of the ATBperp along the phase discrimination line 594 594 ATBperp_tmp = (ATB(i,ncol,nlev)**5)*alpha50 + (ATB(i,ncol,nlev)**4)*beta50 + & … … 610 610 ! to classify the phase cloud 611 611 cldlayphase(i,ncol,4,2) = 1. ! tot cloud 612 if ( p1.gt.0. . and. p1.lt.(440.*100.)) then ! high cloud612 if ( p1.gt.0. .AND. p1.lt.(440.*100.)) then ! high cloud 613 613 cldlayphase(i,ncol,3,2) = 1. 614 else if(p1.ge.(440.*100.) . and. p1.lt.(680.*100.)) then ! mid cloud614 else if(p1.ge.(440.*100.) .AND. p1.lt.(680.*100.)) then ! mid cloud 615 615 cldlayphase(i,ncol,2,2) = 1. 616 616 else ! low cloud … … 618 618 endif 619 619 cldlayphase(i,ncol,4,5) = 1. ! tot cloud 620 if ( p1.gt.0. . and. p1.lt.(440.*100.)) then ! high cloud620 if ( p1.gt.0. .AND. p1.lt.(440.*100.)) then ! high cloud 621 621 cldlayphase(i,ncol,3,5) = 1. 622 else if(p1.ge.(440.*100.) . and. p1.lt.(680.*100.)) then ! mid cloud622 else if(p1.ge.(440.*100.) .AND. p1.lt.(680.*100.)) then ! mid cloud 623 623 cldlayphase(i,ncol,2,5) = 1. 624 624 else ! low cloud … … 631 631 tmpi(i,ncol,nlev)=tmp(i,nlev) 632 632 cldlayphase(i,ncol,4,1) = 1. ! tot cloud 633 if ( p1.gt.0. . and. p1.lt.(440.*100.)) then ! high cloud633 if ( p1.gt.0. .AND. p1.lt.(440.*100.)) then ! high cloud 634 634 cldlayphase(i,ncol,3,1) = 1. 635 else if(p1.ge.(440.*100.) . and. p1.lt.(680.*100.)) then ! mid cloud635 else if(p1.ge.(440.*100.) .AND. p1.lt.(680.*100.)) then ! mid cloud 636 636 cldlayphase(i,ncol,2,1) = 1. 637 637 else ! low cloud … … 652 652 tmpl(i,ncol,nlev)=tmp(i,nlev) 653 653 cldlayphase(i,ncol,4,2) = 1. ! tot cloud 654 if ( p1.gt.0. . and. p1.lt.(440.*100.)) then ! high cloud654 if ( p1.gt.0. .AND. p1.lt.(440.*100.)) then ! high cloud 655 655 cldlayphase(i,ncol,3,2) = 1. 656 else if(p1.ge.(440.*100.) . and. p1.lt.(680.*100.)) then ! mid cloud656 else if(p1.ge.(440.*100.) .AND. p1.lt.(680.*100.)) then ! mid cloud 657 657 cldlayphase(i,ncol,2,2) = 1. 658 658 else ! low cloud … … 667 667 ! to classify the phase cloud 668 668 cldlayphase(i,ncol,4,4) = 1. ! tot cloud 669 if ( p1.gt.0. . and. p1.lt.(440.*100.)) then ! high cloud669 if ( p1.gt.0. .AND. p1.lt.(440.*100.)) then ! high cloud 670 670 cldlayphase(i,ncol,3,4) = 1. 671 else if(p1.ge.(440.*100.) . and. p1.lt.(680.*100.)) then ! mid cloud671 else if(p1.ge.(440.*100.) .AND. p1.lt.(680.*100.)) then ! mid cloud 672 672 cldlayphase(i,ncol,2,4) = 1. 673 673 else ! low cloud … … 675 675 endif 676 676 cldlayphase(i,ncol,4,1) = 1. ! tot cloud 677 if ( p1.gt.0. . and. p1.lt.(440.*100.)) then ! high cloud677 if ( p1.gt.0. .AND. p1.lt.(440.*100.)) then ! high cloud 678 678 cldlayphase(i,ncol,3,1) = 1. 679 else if(p1.ge.(440.*100.) . and. p1.lt.(680.*100.)) then ! mid cloud679 else if(p1.ge.(440.*100.) .AND. p1.lt.(680.*100.)) then ! mid cloud 680 680 cldlayphase(i,ncol,2,1) = 1. 681 681 else ! low cloud … … 699 699 p1 = pplay(i,nlev) 700 700 701 if( (cldy(i,ncol,nlev).eq.1.) . and. (ATBperp(i,ncol,nlev).gt.0.) )then701 if( (cldy(i,ncol,nlev).eq.1.) .AND. (ATBperp(i,ncol,nlev).gt.0.) )then 702 702 ! Phase discrimination line : ATBperp = ATB^5*alpha50 + ATB^4*beta50 + ATB^3*gamma50 + ATB^2*delta50 703 703 ! + ATB*epsilon50 + zeta50 … … 719 719 720 720 cldlayphase(i,ncol,4,2) = 1. ! tot cloud 721 if ( p1.gt.0. . and. p1.lt.(440.*100.)) then ! high cloud721 if ( p1.gt.0. .AND. p1.lt.(440.*100.)) then ! high cloud 722 722 cldlayphase(i,ncol,3,2) = 1. 723 else if(p1.ge.(440.*100.) . and. p1.lt.(680.*100.)) then ! mid cloud723 else if(p1.ge.(440.*100.) .AND. p1.lt.(680.*100.)) then ! mid cloud 724 724 cldlayphase(i,ncol,2,2) = 1. 725 725 else ! low cloud … … 728 728 729 729 cldlayphase(i,ncol,4,5) = 1. ! tot cloud 730 if ( p1.gt.0. . and. p1.lt.(440.*100.)) then ! high cloud730 if ( p1.gt.0. .AND. p1.lt.(440.*100.)) then ! high cloud 731 731 cldlayphase(i,ncol,3,5) = 1. 732 else if(p1.ge.(440.*100.) . and. p1.lt.(680.*100.)) then ! mid cloud732 else if(p1.ge.(440.*100.) .AND. p1.lt.(680.*100.)) then ! mid cloud 733 733 cldlayphase(i,ncol,2,5) = 1. 734 734 else ! low cloud … … 742 742 743 743 cldlayphase(i,ncol,4,1) = 1. ! tot cloud 744 if ( p1.gt.0. . and. p1.lt.(440.*100.)) then ! high cloud744 if ( p1.gt.0. .AND. p1.lt.(440.*100.)) then ! high cloud 745 745 cldlayphase(i,ncol,3,1) = 1. 746 else if(p1.ge.(440.*100.) . and. p1.lt.(680.*100.)) then ! mid cloud746 else if(p1.ge.(440.*100.) .AND. p1.lt.(680.*100.)) then ! mid cloud 747 747 cldlayphase(i,ncol,2,1) = 1. 748 748 else ! low cloud … … 764 764 765 765 cldlayphase(i,ncol,4,2) = 1. ! tot cloud 766 if ( p1.gt.0. . and. p1.lt.(440.*100.)) then ! high cloud766 if ( p1.gt.0. .AND. p1.lt.(440.*100.)) then ! high cloud 767 767 cldlayphase(i,ncol,3,2) = 1. 768 else if(p1.ge.(440.*100.) . and. p1.lt.(680.*100.)) then ! mid cloud768 else if(p1.ge.(440.*100.) .AND. p1.lt.(680.*100.)) then ! mid cloud 769 769 cldlayphase(i,ncol,2,2) = 1. 770 770 else ! low cloud … … 779 779 780 780 cldlayphase(i,ncol,4,4) = 1. ! tot cloud 781 if ( p1.gt.0. . and. p1.lt.(440.*100.)) then ! high cloud781 if ( p1.gt.0. .AND. p1.lt.(440.*100.)) then ! high cloud 782 782 cldlayphase(i,ncol,3,4) = 1. 783 else if(p1.ge.(440.*100.) . and. p1.lt.(680.*100.)) then ! mid cloud783 else if(p1.ge.(440.*100.) .AND. p1.lt.(680.*100.)) then ! mid cloud 784 784 cldlayphase(i,ncol,2,4) = 1. 785 785 else ! low cloud … … 788 788 789 789 cldlayphase(i,ncol,4,1) = 1. ! tot cloud 790 if ( p1.gt.0. . and. p1.lt.(440.*100.)) then ! high cloud790 if ( p1.gt.0. .AND. p1.lt.(440.*100.)) then ! high cloud 791 791 cldlayphase(i,ncol,3,1) = 1. 792 else if(p1.ge.(440.*100.) . and. p1.lt.(680.*100.)) then ! mid cloud792 else if(p1.ge.(440.*100.) .AND. p1.lt.(680.*100.)) then ! mid cloud 793 793 cldlayphase(i,ncol,2,1) = 1. 794 794 else ! low cloud … … 826 826 827 827 cldlayphase(i,ncol,4,3) = 1. ! tot cloud 828 if ( p1.gt.0. . and. p1.lt.(440.*100.)) then ! high cloud828 if ( p1.gt.0. .AND. p1.lt.(440.*100.)) then ! high cloud 829 829 cldlayphase(i,ncol,3,3) = 1. 830 else if(p1.ge.(440.*100.) . and. p1.lt.(680.*100.)) then ! mid cloud830 else if(p1.ge.(440.*100.) .AND. p1.lt.(680.*100.)) then ! mid cloud 831 831 cldlayphase(i,ncol,2,3) = 1. 832 832 else ! low cloud … … 939 939 DO itemp=1,Ntemp 940 940 if(tmpi(i,ncol,nlev).gt.0.)then 941 if( (tmpi(i,ncol,nlev).ge.tempmod(itemp)). and.(tmpi(i,ncol,nlev).lt.tempmod(itemp+1)) )then941 if( (tmpi(i,ncol,nlev).ge.tempmod(itemp)).AND.(tmpi(i,ncol,nlev).lt.tempmod(itemp+1)) )then 942 942 lidarcldtemp(i,itemp,2)=lidarcldtemp(i,itemp,2)+1. 943 943 endif 944 944 elseif(tmpl(i,ncol,nlev).gt.0.)then 945 if( (tmpl(i,ncol,nlev).ge.tempmod(itemp)). and.(tmpl(i,ncol,nlev).lt.tempmod(itemp+1)) )then945 if( (tmpl(i,ncol,nlev).ge.tempmod(itemp)).AND.(tmpl(i,ncol,nlev).lt.tempmod(itemp+1)) )then 946 946 lidarcldtemp(i,itemp,3)=lidarcldtemp(i,itemp,3)+1. 947 947 endif 948 948 elseif(tmpu(i,ncol,nlev).gt.0.)then 949 if( (tmpu(i,ncol,nlev).ge.tempmod(itemp)). and.(tmpu(i,ncol,nlev).lt.tempmod(itemp+1)) )then949 if( (tmpu(i,ncol,nlev).ge.tempmod(itemp)).AND.(tmpu(i,ncol,nlev).lt.tempmod(itemp+1)) )then 950 950 lidarcldtemp(i,itemp,4)=lidarcldtemp(i,itemp,4)+1. 951 951 endif … … 1042 1042 DO k=1,Nlevels 1043 1043 ! Cloud detection at subgrid-scale: 1044 where ( (x(:,:,k) .gt. S_cld) . and. (x(:,:,k) .ne. undef) )1044 where ( (x(:,:,k) .gt. S_cld) .AND. (x(:,:,k) .ne. undef) ) 1045 1045 cldy(:,:,k)=1.0 1046 1046 elsewhere … … 1048 1048 endwhere 1049 1049 ! Fully attenuated layer detection at subgrid-scale: 1050 where ( (x(:,:,k) .gt. 0.0) . and. (x(:,:,k) .lt. S_att_opaq) .and. (x(:,:,k) .ne. undef) )1050 where ( (x(:,:,k) .gt. 0.0) .AND. (x(:,:,k) .lt. S_att_opaq) .AND. (x(:,:,k) .ne. undef) ) 1051 1051 cldyopaq(:,:,k)=1.0 1052 1052 elsewhere … … 1055 1055 1056 1056 ! Number of useful sub-column layers: 1057 where ( (x(:,:,k) .gt. S_att) . and. (x(:,:,k) .ne. undef) )1057 where ( (x(:,:,k) .gt. S_att) .AND. (x(:,:,k) .ne. undef) ) 1058 1058 srok(:,:,k)=1.0 1059 1059 elsewhere … … 1061 1061 endwhere 1062 1062 ! Number of useful sub-columns layers for z_opaque 3D fraction: 1063 where ( (x(:,:,k) .gt. 0.0) . and. (x(:,:,k) .ne. undef) )1063 where ( (x(:,:,k) .gt. 0.0) .AND. (x(:,:,k) .ne. undef) ) 1064 1064 srokopaq(:,:,k)=1.0 1065 1065 elsewhere … … 1094 1094 1095 1095 ! Declaring non-opaque cloudy profiles as thin cloud profiles 1096 if ( (cldlay(ip,ic,4) .eq. 1.0) . and. (cldlay(ip,ic,1) .eq. 0.0) ) then1096 if ( (cldlay(ip,ic,4) .eq. 1.0) .AND. (cldlay(ip,ic,1) .eq. 0.0) ) then 1097 1097 cldlay(ip,ic,2) = 1.0 1098 1098 endif … … 1105 1105 DO k=2,Nlevels 1106 1106 ! Declaring opaque cloud fraction and z_opaque altitude for 3D and 2D variables 1107 if ( (cldy(ip,ic,k) .eq. 1.0) . and. (zopac .eq. 0.0) ) then1107 if ( (cldy(ip,ic,k) .eq. 1.0) .AND. (zopac .eq. 0.0) ) then 1108 1108 lidarcldtype(ip,k-1,3) = lidarcldtype(ip,k-1,3) + 1.0 1109 1109 cldlay(ip,ic,3) = vgrid_z(k-1) !z_opaque altitude -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_modis_sim.F90
r5158 r5185 249 249 ! Initialize initial estimates for size retrievals 250 250 251 if(any(cloudMask) . and. .not. useSimpleReScheme) then251 if(any(cloudMask) .AND. .not. useSimpleReScheme) then 252 252 g_w(:) = get_g_nir( phaseIsLiquid, trial_re_w(:)) 253 253 w0_w(:) = get_ssa_nir(phaseIsLiquid, trial_re_w(:)) … … 319 319 end if 320 320 end do 321 where((retrievedSize(:) < 0.). and.(retrievedSize(:) /= R_UNDEF)) retrievedSize(:) = 1.0e-06*re_fill321 where((retrievedSize(:) < 0.).AND.(retrievedSize(:) /= R_UNDEF)) retrievedSize(:) = 1.0e-06*re_fill 322 322 323 323 ! We use the ISCCP-derived CTP for low clouds, since the ISCCP simulator ICARUS … … 325 325 ! Of course, ISCCP cloud top pressures are in mb. 326 326 327 where(cloudMask(:) . and. retrievedCloudTopPressure(:) > CO2Slicing_PressureLimit) &327 where(cloudMask(:) .AND. retrievedCloudTopPressure(:) > CO2Slicing_PressureLimit) & 328 328 retrievedCloudTopPressure(:) = isccpCloudTopPressure * 100. 329 329 … … 475 475 ! ######################################################################################## 476 476 validRetrievalMask(1:nPoints,1:nSubCols) = particle_size(1:nPoints,1:nSubCols) > 0. 477 cloudMask(1:nPoints,1:nSubCols) = phase(1:nPoints,1:nSubCols) /= phaseIsNone . and. &477 cloudMask(1:nPoints,1:nSubCols) = phase(1:nPoints,1:nSubCols) /= phaseIsNone .AND. & 478 478 validRetrievalMask(1:nPoints,1:nSubCols) 479 waterCloudMask(1:nPoints,1:nSubCols) = phase(1:nPoints,1:nSubCols) == phaseIsLiquid . and. &479 waterCloudMask(1:nPoints,1:nSubCols) = phase(1:nPoints,1:nSubCols) == phaseIsLiquid .AND. & 480 480 validRetrievalMask(1:nPoints,1:nSubCols) 481 iceCloudMask(1:nPoints,1:nSubCols) = phase(1:nPoints,1:nSubCols) == phaseIsIce . and. &481 iceCloudMask(1:nPoints,1:nSubCols) = phase(1:nPoints,1:nSubCols) == phaseIsIce .AND. & 482 482 validRetrievalMask(1:nPoints,1:nSubCols) 483 483 … … 488 488 Cloud_Fraction_Water_Mean(1:nPoints) = real(count(waterCloudMask, dim = 2)) 489 489 Cloud_Fraction_Ice_Mean(1:nPoints) = real(count(iceCloudMask, dim = 2)) 490 Cloud_Fraction_High_Mean(1:nPoints) = real(count(cloudMask . and. cloud_top_pressure <= &490 Cloud_Fraction_High_Mean(1:nPoints) = real(count(cloudMask .AND. cloud_top_pressure <= & 491 491 highCloudPressureLimit, dim = 2)) 492 Cloud_Fraction_Low_Mean(1:nPoints) = real(count(cloudMask . and. cloud_top_pressure > &492 Cloud_Fraction_Low_Mean(1:nPoints) = real(count(cloudMask .AND. cloud_top_pressure > & 493 493 lowCloudPressureLimit, dim = 2)) 494 494 Cloud_Fraction_Mid_Mean(1:nPoints) = Cloud_Fraction_Total_Mean(1:nPoints) - Cloud_Fraction_High_Mean(1:nPoints)& … … 653 653 DO ij=2,nbin1+1 654 654 DO ik=2,nbin2+1 655 jointHist(ij-1,ik-1)=count(var1 .ge. bin1(ij-1) . and. var1 .lt. bin1(ij) .and. &656 var2 .ge. bin2(ik-1) . and. var2 .lt. bin2(ik))655 jointHist(ij-1,ik-1)=count(var1 .ge. bin1(ij-1) .AND. var1 .lt. bin1(ij) .AND. & 656 var2 .ge. bin2(ik-1) .AND. var2 .lt. bin2(ik)) 657 657 enddo 658 658 enddo … … 719 719 720 720 validRetrievalMask(:, :) = particle_size(:, :) > 0. 721 cloudMask = phase(:, :) /= phaseIsNone . and. validRetrievalMask(:, :)722 waterCloudMask = phase(:, :) == phaseIsLiquid . and. validRetrievalMask(:, :)723 iceCloudMask = phase(:, :) == phaseIsIce . and. validRetrievalMask(:, :)721 cloudMask = phase(:, :) /= phaseIsNone .AND. validRetrievalMask(:, :) 722 waterCloudMask = phase(:, :) == phaseIsLiquid .AND. validRetrievalMask(:, :) 723 iceCloudMask = phase(:, :) == phaseIsIce .AND. validRetrievalMask(:, :) 724 724 725 725 ! Use these as pixel counts at first … … 729 729 Cloud_Fraction_Ice_Mean(:) = real(count(iceCloudMask, dim = 2)) 730 730 731 Cloud_Fraction_High_Mean(:) = real(count(cloudMask . and. cloud_top_pressure <= highCloudPressureLimit, dim = 2))732 Cloud_Fraction_Low_Mean(:) = real(count(cloudMask . and. cloud_top_pressure > lowCloudPressureLimit, dim = 2))731 Cloud_Fraction_High_Mean(:) = real(count(cloudMask .AND. cloud_top_pressure <= highCloudPressureLimit, dim = 2)) 732 Cloud_Fraction_Low_Mean(:) = real(count(cloudMask .AND. cloud_top_pressure > lowCloudPressureLimit, dim = 2)) 733 733 Cloud_Fraction_Mid_Mean(:) = Cloud_Fraction_Total_Mean(:) - Cloud_Fraction_High_Mean(:) - Cloud_Fraction_Low_Mean(:) 734 734 … … 780 780 DO i = 1, numTauHistogramBins 781 781 where(cloudMask(:, :)) 782 tauMask(:, :, i) = optical_thickness(:, :) >= tauHistogramBoundaries(i) . and. &782 tauMask(:, :, i) = optical_thickness(:, :) >= tauHistogramBoundaries(i) .AND. & 783 783 optical_thickness(:, :) < tauHistogramBoundaries(i+1) 784 784 elsewhere … … 789 789 DO i = 1, numPressureHistogramBins 790 790 where(cloudMask(:, :)) 791 pressureMask(:, :, i) = cloud_top_pressure(:, :) >= pressureHistogramBoundaries(i) . and. &791 pressureMask(:, :, i) = cloud_top_pressure(:, :) >= pressureHistogramBoundaries(i) .AND. & 792 792 cloud_top_pressure(:, :) < pressureHistogramBoundaries(i+1) 793 793 elsewhere … … 799 799 DO j = 1, numTauHistogramBins 800 800 Optical_Thickness_vs_Cloud_Top_Pressure(:, j, i) = & 801 real(count(tauMask(:, :, j) . and. pressureMask(:, :, i), dim = 2)) / real(nSubcols)801 real(count(tauMask(:, :, j) .AND. pressureMask(:, :, i), dim = 2)) / real(nSubcols) 802 802 end do 803 803 end do … … 936 936 937 937 ! DJS2015: Remove unused piece of code 938 ! if(use_two_re_iterations . and. retrieve_re > 0.) then938 ! if(use_two_re_iterations .AND. retrieve_re > 0.) then 939 939 ! re_min = retrieve_re - delta_re 940 940 ! re_max = retrieve_re + delta_re -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/phys_cosp.F90
r5160 r5185 201 201 202 202 !!! Ici on modifie les cles logiques pour les outputs selon les champs actives dans les .xml 203 if ((itap.gt.1). and.(first_write))then203 if ((itap.gt.1).AND.(first_write))then 204 204 205 205 IF (using_xios) call read_xiosfieldactive(cfg) -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/prec_scops.F
r5099 r5185 192 192 endif 193 193 enddo ! loop over ncol 194 if ((flag_ls .eq. 0) . and. (ilev .lt. nlev)) then ! possibility THREE194 if ((flag_ls .eq. 0) .AND. (ilev .lt. nlev)) then ! possibility THREE 195 195 do ibox=1,ncol 196 196 if (frac_out(j,ibox,ilev+1) .eq. 1) then … … 229 229 endif 230 230 enddo ! loop over ncol 231 if ((flag_cv .eq. 0) . and. (ilev .lt. nlev)) then ! possibility THREE231 if ((flag_cv .eq. 0) .AND. (ilev .lt. nlev)) then ! possibility THREE 232 232 do ibox=1,ncol 233 233 if (frac_out(j,ibox,ilev+1) .eq. 2) then -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/radar_simulator.F90
r5160 r5185 187 187 hydro = .false. 188 188 DO j=1,hp%nhclass 189 if ((hm_matrix(j,pr,k) > 1E-12) . and. (hp%dtype(j) > 0)) then189 if ((hm_matrix(j,pr,k) > 1E-12) .AND. (hp%dtype(j) > 0)) then 190 190 hydro = .true. 191 191 exit … … 298 298 else 299 299 ! I assume here that water phase droplets are spheres. 300 ! hp%rho should be ~ 1000 or hp%apm=524 . and. hp%bpm=3300 ! hp%rho should be ~ 1000 or hp%apm=524 .AND. hp%bpm=3 301 301 Deq = Di 302 302 endif … … 311 311 ! NOTE: if .not. DO_LUT_TEST, then you are checking the LUT approximation 312 312 ! not just the DSD representation given by Ni 313 if(Np_matrix(tp,pr,k)>0 . and. DO_NP_TEST ) then313 if(Np_matrix(tp,pr,k)>0 .AND. DO_NP_TEST ) then 314 314 Np = path_integral(Ni,Di,1,ns-1)/rho_a*1E6 315 315 ! Note: Representation is not great or small Re < 2 … … 326 326 ! LUT test code 327 327 ! This segment of code compares full calculation to scaling result 328 if ( hp%Z_scale_flag(tp,itt,iRe_type) . and. DO_LUT_TEST ) then328 if ( hp%Z_scale_flag(tp,itt,iRe_type) .AND. DO_LUT_TEST ) then 329 329 scale_factor=rho_a*hm_matrix(tp,pr,k) 330 330 ! if more than 2 dBZe difference print error message/parameters. … … 400 400 g_to_vol(pr,k) = g_to_vol_in(pr,k) 401 401 else 402 if ( (hp%use_gas_abs == 1) .or. ((hp%use_gas_abs == 2) . and. (pr == 1)) ) then402 if ( (hp%use_gas_abs == 1) .or. ((hp%use_gas_abs == 2) .AND. (pr == 1)) ) then 403 403 g_vol(pr,k) = gases(p_matrix(pr,k),t_kelvin,rh_matrix(pr,k),hp%freq) 404 404 if (d_gate==1) then … … 428 428 429 429 ! Compute Rayleigh reflectivity, and full, attenuated reflectivity 430 if ((hp%do_ray == 1) . and. (z_ray(pr,k) > 0)) then430 if ((hp%do_ray == 1) .AND. (z_ray(pr,k) > 0)) then 431 431 Ze_ray(pr,k) = 10*log10(z_ray(pr,k)) 432 432 else -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/scops.F
r5099 r5185 236 236 if (threshold(j,ibox) 237 237 & .lt.min(tca(j,ilev-1),tca(j,ilev)) 238 & . and.(threshold(j,ibox).gt.conv(j,ilev))) then238 & .AND.(threshold(j,ibox).gt.conv(j,ilev))) then 239 239 maxosc(j,ibox)= 1 240 240 else -
LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/zeff.F90
r5158 r5185 99 99 100 100 correct_for_rho = 0 101 if ((ice == 1) . and. (minval(rho_e) >= 0)) correct_for_rho = 1101 if ((ice == 1) .AND. (minval(rho_e) >= 0)) correct_for_rho = 1 102 102 103 103 ! :: correct refractive index for ice density if needed -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/MISR_simulator.F90
r5159 r5185 110 110 DO ilev=1,nlev 111 111 ! If there a cloud, start the counter and store this height 112 if(thres_crossed_MISR .eq. 0 . and. dtau(j,ibox,ilev) .gt. 0.) then112 if(thres_crossed_MISR .eq. 0 .AND. dtau(j,ibox,ilev) .gt. 0.) then 113 113 ! First encountered a "cloud" 114 114 thres_crossed_MISR = 1 … … 116 116 endif 117 117 118 if( thres_crossed_MISR .lt. 99 . and. thres_crossed_MISR .gt. 0 ) then118 if( thres_crossed_MISR .lt. 99 .AND. thres_crossed_MISR .gt. 0 ) then 119 119 if( dtau(j,ibox,ilev) .eq. 0.) then 120 120 ! We have come to the end of the current cloud layer without yet … … 129 129 ! current layer cloud top to the current level then MISR will like 130 130 ! see a top below the top of the current layer. 131 if( dtau(j,ibox,ilev).gt.0 . and. (cloud_dtau-dtau(j,ibox,ilev)) .lt. 1) then131 if( dtau(j,ibox,ilev).gt.0 .AND. (cloud_dtau-dtau(j,ibox,ilev)) .lt. 1) then 132 132 if(dtau(j,ibox,ilev) .lt. 1 .or. ilev.eq.1 .or. ilev.eq.nlev) then 133 133 ! MISR will likely penetrate to some point within this layer ... the middle … … 142 142 143 143 ! Check for a distinctive water layer 144 if(dtau(j,ibox,ilev) .gt. 1 . and. at(j,ilev) .gt. 273 ) then144 if(dtau(j,ibox,ilev) .gt. 1 .AND. at(j,ilev) .gt. 273 ) then 145 145 ! Must be a water cloud, take this as CTH level 146 146 thres_crossed_MISR=99 … … 191 191 ! ! Adjust based on neightboring points. 192 192 ! do j=2,npoints-1 193 ! if(box_MISR_ztop(j-1,1) .gt. 0 . and. &194 ! box_MISR_ztop(j+1,1) .gt. 0 . and. &195 ! abs(box_MISR_ztop(j-1,1)-box_MISR_ztop(j+1,1)) .lt. 500 . and. &193 ! if(box_MISR_ztop(j-1,1) .gt. 0 .AND. & 194 ! box_MISR_ztop(j+1,1) .gt. 0 .AND. & 195 ! abs(box_MISR_ztop(j-1,1)-box_MISR_ztop(j+1,1)) .lt. 500 .AND. & 196 196 ! box_MISR_ztop(j,1) .lt. box_MISR_ztop(j+1,1)) then 197 197 ! box_MISR_ztop(j,1) = box_MISR_ztop(j+1,1) … … 202 202 ! do j=1,npoints 203 203 ! do ibox=2,ncol-1 204 ! if(box_MISR_ztop(j,ibox-1) .gt. 0 . and. &205 ! box_MISR_ztop(j,ibox+1) .gt. 0 . and. &206 ! abs(box_MISR_ztop(j,ibox-1)-box_MISR_ztop(j,ibox+1)) .lt. 500 . and. &204 ! if(box_MISR_ztop(j,ibox-1) .gt. 0 .AND. & 205 ! box_MISR_ztop(j,ibox+1) .gt. 0 .AND. & 206 ! abs(box_MISR_ztop(j,ibox-1)-box_MISR_ztop(j,ibox+1)) .lt. 500 .AND. & 207 207 ! box_MISR_ztop(j,ibox) .lt. box_MISR_ztop(j,ibox+1)) then 208 208 ! box_MISR_ztop(j,ibox) = box_MISR_ztop(j,ibox+1) -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp.F90
r5158 r5185 381 381 ! 1) Determine if using full inputs or subset 382 382 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 383 if (present(start_idx) . and. present(stop_idx)) then383 if (present(start_idx) .AND. present(stop_idx)) then 384 384 ij=start_idx 385 385 ik=stop_idx … … 932 932 933 933 ! Check if there is any value slightly greater than 1 934 where ((cospOUT%isccp_totalcldarea > 1.0-1.e-5) . and. &934 where ((cospOUT%isccp_totalcldarea > 1.0-1.e-5) .AND. & 935 935 (cospOUT%isccp_totalcldarea < 1.0+1.e-5)) 936 936 cospOUT%isccp_totalcldarea = 1.0 -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_optics.F90
r5158 r5185 306 306 ! Do we need to generate optical inputs for Parasol simulator? 307 307 lparasol = .false. 308 if (present(tautot_S_liq) . and. present(tautot_S_ice)) lparasol = .true.308 if (present(tautot_S_liq) .AND. present(tautot_S_ice)) lparasol = .true. 309 309 310 310 ! Are optical-depths and backscatter coefficients for ice and liquid requested? 311 311 lphaseoptics=.false. 312 if (present(betatot_ice) . and. present(betatot_liq) .and. present(tautot_liq) .and. &312 if (present(betatot_ice) .AND. present(betatot_liq) .AND. present(tautot_liq) .AND. & 313 313 present(tautot_ice)) lphaseoptics=.true. 314 314 -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_stats.F90
r5158 r5185 217 217 DO j=1,Nlevels 218 218 sc_ratio = beta_tot(pr,i,j)/beta_mol(pr,j) 219 if ((sc_ratio .le. s_att) . and. (flag_sat .eq. 0)) flag_sat = j219 if ((sc_ratio .le. s_att) .AND. (flag_sat .eq. 0)) flag_sat = j 220 220 if (Ze_tot(pr,i,j) .lt. -30.) then !radar can't detect cloud 221 221 if ( (sc_ratio .gt. s_cld) .or. (flag_sat .eq. j) ) then !lidar sense cloud … … 267 267 268 268 DO ij=2,Nbins+1 269 hist1D(ij-1) = count(var .ge. bins(ij-1) . and. var .lt. bins(ij))269 hist1D(ij-1) = count(var .ge. bins(ij-1) .AND. var .lt. bins(ij)) 270 270 if (count(var .eq. R_GROUND) .ge. 1) hist1D(ij-1)=R_UNDEF 271 271 enddo … … 300 300 DO ij=2,nbin1+1 301 301 DO ik=2,nbin2+1 302 jointHist(ij-1,ik-1)=count(var1 .ge. bin1(ij-1) . and. var1 .lt. bin1(ij) .and. &303 var2 .ge. bin2(ik-1) . and. var2 .lt. bin2(ik))302 jointHist(ij-1,ik-1)=count(var1 .ge. bin1(ij-1) .AND. var1 .lt. bin1(ij) .AND. & 303 var2 .ge. bin2(ik-1) .AND. var2 .lt. bin2(ik)) 304 304 enddo 305 305 enddo -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_utils.F90
r5158 r5185 85 85 mxratio(i,j,k)=mxratio(i,j,k)/rho 86 86 ! Compute effective radius 87 ! if ((reff(i,j,k) <= 0._wp). and.(flux(i,k) /= 0._wp)) then88 if ((reff(i,j,k) <= 0._wp). and.(flux(i,k) > seuil)) then87 ! if ((reff(i,j,k) <= 0._wp).AND.(flux(i,k) /= 0._wp)) then 88 if ((reff(i,j,k) <= 0._wp).AND.(flux(i,k) > seuil)) then 89 89 lambda_x = (a_x*c_x*((rho0/rho)**g_x)*n_ax*gamma1/flux(i,k))**(1._wp/delta) 90 90 reff(i,j,k) = gamma_4_3_2/lambda_x -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/icarus.F90
r5159 r5185 232 232 233 233 DO ilev=1,nlev 234 where(pfull(1:npoints,ilev) .lt. 40000. . and. &235 pfull(1:npoints,ilev) .gt. 5000. . and. &234 where(pfull(1:npoints,ilev) .lt. 40000. .AND. & 235 pfull(1:npoints,ilev) .gt. 5000. .AND. & 236 236 at(1:npoints,ilev) .lt. attropmin(1:npoints)) 237 237 ptrop(1:npoints) = pfull(1:npoints,ilev) … … 244 244 DO ilev=1,nlev 245 245 atmax(1:npoints) = merge(at(1:npoints,ilev),atmax(1:npoints),& 246 at(1:npoints,ilev) .gt. atmax(1:npoints) . and. ilev .ge. itrop(1:npoints))246 at(1:npoints,ilev) .gt. atmax(1:npoints) .AND. ilev .ge. itrop(1:npoints)) 247 247 enddo 248 248 end if … … 350 350 if (isccp_top_height .eq. 1) then 351 351 DO j=1,npoints 352 if (transmax(j) .gt. 0.001 . and. transmax(j) .le. 0.9999999) then352 if (transmax(j) .gt. 0.001 .AND. transmax(j) .le. 0.9999999) then 353 353 fluxtopinit(j) = fluxtop(j,ibox) 354 354 tauir(j) = tau(j,ibox)/2.13_wp … … 358 358 DO j=1,npoints 359 359 if (tau(j,ibox) .gt. (tauchk)) then 360 if (transmax(j) .gt. 0.001 . and. transmax(j) .le. 0.9999999) then360 if (transmax(j) .gt. 0.001 .AND. transmax(j) .le. 0.9999999) then 361 361 emcld(j,ibox) = 1._wp - exp(-1._wp * tauir(j) ) 362 362 fluxtop(j,ibox) = fluxtopinit(j) - ((1.-emcld(j,ibox))*fluxtop_clrsky(j)) … … 375 375 where(tau(1:npoints,ibox) .gt. tauchk) 376 376 tb(1:npoints,ibox)= 1307.27_wp/ (log(1. + (1._wp/fluxtop(1:npoints,ibox)))) 377 where (isccp_top_height .eq. 1 . and. tauir(1:npoints) .lt. taumin(1:npoints))377 where (isccp_top_height .eq. 1 .AND. tauir(1:npoints) .lt. taumin(1:npoints)) 378 378 tb(1:npoints,ibox) = attrop(1:npoints) - 5._wp 379 379 tau(1:npoints,ibox) = 2.13_wp*taumin(1:npoints) … … 406 406 ilev = merge(nlev-k1,k1,isccp_top_height_direction .eq. 2) 407 407 DO j=1,npoints 408 if (ilev .ge. itrop(j) . and. &409 ((at(j,ilev) .ge. tb(j,ibox) . and. &408 if (ilev .ge. itrop(j) .AND. & 409 ((at(j,ilev) .ge. tb(j,ibox) .AND. & 410 410 at(j,ilev+1) .le. tb(j,ibox)) .or. & 411 (at(j,ilev) .le. tb(j,ibox) . and. &411 (at(j,ilev) .le. tb(j,ibox) .AND. & 412 412 at(j,ilev+1) .ge. tb(j,ibox)))) then 413 413 nmatch(j)=nmatch(j)+1 … … 441 441 ptop(1:npoints,ibox)=0. 442 442 DO ilev=1,nlev 443 where((ptop(1:npoints,ibox) .eq. 0. ) . and.(frac_out(1:npoints,ibox,ilev) .ne. 0))443 where((ptop(1:npoints,ibox) .eq. 0. ) .AND.(frac_out(1:npoints,ibox,ilev) .ne. 0)) 444 444 ptop(1:npoints,ibox)=phalf(1:npoints,ilev) 445 445 levmatch(1:npoints,ibox)=ilev … … 460 460 DO ibox=1,ncol 461 461 DO j=1,npoints 462 if (tau(j,ibox) .gt. (tauchk) . and. ptop(j,ibox) .gt. 0.) then462 if (tau(j,ibox) .gt. (tauchk) .AND. ptop(j,ibox) .gt. 0.) then 463 463 if (sunlit(j).eq.1 .or. isccp_top_height .eq. 3) then 464 464 boxtau(j,ibox) = tau(j,ibox) … … 561 561 DO j=1,npoints 562 562 ! Subcolumns that are cloudy(true) and not(false) 563 box_cloudy2(1:ncol) = merge(.true.,.false.,boxtau(j,1:ncol) .gt. tauchk . and. boxptop(j,1:ncol) .gt. 0.)563 box_cloudy2(1:ncol) = merge(.true.,.false.,boxtau(j,1:ncol) .gt. tauchk .AND. boxptop(j,1:ncol) .gt. 0.) 564 564 565 565 ! Compute joint histogram and column quantities for points that are sunlit and cloudy … … 572 572 573 573 ! Column cloud area 574 totalcldarea(j) = real(count(box_cloudy2(1:ncol) . and. boxtau(j,1:ncol) .gt. isccp_taumin))/ncol574 totalcldarea(j) = real(count(box_cloudy2(1:ncol) .AND. boxtau(j,1:ncol) .gt. isccp_taumin))/ncol 575 575 576 576 ! Subcolumn cloud albedo 577 577 !albedocld(j,1:ncol) = merge((boxtau(j,1:ncol)**0.895_wp)/((boxtau(j,1:ncol)**0.895_wp)+6.82_wp),& 578 ! 0._wp,box_cloudy2(1:ncol) . and. boxtau(j,1:ncol) .gt. isccp_taumin)579 where(box_cloudy2(1:ncol) . and. boxtau(j,1:ncol) .gt. isccp_taumin)578 ! 0._wp,box_cloudy2(1:ncol) .AND. boxtau(j,1:ncol) .gt. isccp_taumin) 579 where(box_cloudy2(1:ncol) .AND. boxtau(j,1:ncol) .gt. isccp_taumin) 580 580 albedocld(j,1:ncol) = (boxtau(j,1:ncol)**0.895_wp)/((boxtau(j,1:ncol)**0.895_wp)+6.82_wp) 581 581 elsewhere … … 587 587 588 588 ! Column cloud top pressure 589 meanptop(j) = sum(boxptop(j,1:ncol),box_cloudy2(1:ncol) . and. boxtau(j,1:ncol) .gt. isccp_taumin)/ncol589 meanptop(j) = sum(boxptop(j,1:ncol),box_cloudy2(1:ncol) .AND. boxtau(j,1:ncol) .gt. isccp_taumin)/ncol 590 590 endif 591 591 enddo -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lidar_simulator.F90
r5160 r5185 152 152 ! Phase optics? 153 153 lphaseoptics=.false. 154 if (present(betatot_ice) . and. present(betatot_liq) .and. present(tautot_liq) .and. &154 if (present(betatot_ice) .AND. present(betatot_liq) .AND. present(tautot_liq) .AND. & 155 155 present(tautot_ice)) lphaseoptics=.true. 156 156 … … 400 400 DO ic = 1, ncol 401 401 pnorm_c = pnormFlip(:,ic,:) 402 where ((pnorm_c .lt. xmax) . and. (betamolFlip(:,1,:) .lt. xmax) .and. &402 where ((pnorm_c .lt. xmax) .AND. (betamolFlip(:,1,:) .lt. xmax) .AND. & 403 403 (betamolFlip(:,1,:) .gt. 0.0 )) 404 404 x3d_c = pnorm_c/betamolFlip(:,1,:) … … 429 429 DO ic = 1, ncol 430 430 pnorm_c = pnorm(:,ic,:) 431 where ((pnorm_c.lt.xmax) . and. (pmol.lt.xmax) .and. (pmol.gt. 0.0 ))431 where ((pnorm_c.lt.xmax) .AND. (pmol.lt.xmax) .AND. (pmol.gt. 0.0 )) 432 432 x3d_c = pnorm_c/pmol 433 433 elsewhere … … 650 650 DO k=1,Nlevels 651 651 ! Cloud detection at subgrid-scale: 652 where ((x(:,:,k) .gt. S_cld) . and. (x(:,:,k) .ne. undef) )652 where ((x(:,:,k) .gt. S_cld) .AND. (x(:,:,k) .ne. undef) ) 653 653 cldy(:,:,k)=1._wp 654 654 elsewhere … … 657 657 658 658 ! Number of usefull sub-columns: 659 where ((x(:,:,k) .gt. S_att) . and. (x(:,:,k) .ne. undef) )659 where ((x(:,:,k) .gt. S_att) .AND. (x(:,:,k) .ne. undef) ) 660 660 srok(:,:,k)=1._wp 661 661 elsewhere … … 679 679 if(srok(ip,ic,k).gt.0.)then 680 680 DO itemp=1,Ntemp 681 if( (tmp(ip,k).ge.tempmod(itemp)). and.(tmp(ip,k).lt.tempmod(itemp+1)) )then681 if( (tmp(ip,k).ge.tempmod(itemp)).AND.(tmp(ip,k).lt.tempmod(itemp+1)) )then 682 682 lidarcldtempind(ip,itemp)=lidarcldtempind(ip,itemp)+1._wp 683 683 endif … … 687 687 if(cldy(ip,ic,k).eq.1.)then 688 688 DO itemp=1,Ntemp 689 if( (tmp(ip,k) .ge. tempmod(itemp)). and.(tmp(ip,k) .lt. tempmod(itemp+1)) )then689 if( (tmp(ip,k) .ge. tempmod(itemp)).AND.(tmp(ip,k) .lt. tempmod(itemp+1)) )then 690 690 lidarcldtemp(ip,itemp,1)=lidarcldtemp(ip,itemp,1)+1._wp 691 691 endif … … 695 695 iz=1 696 696 p1 = pplay(ip,k) 697 if ( p1.gt.0. . and. p1.lt.(440._wp*100._wp)) then ! high clouds697 if ( p1.gt.0. .AND. p1.lt.(440._wp*100._wp)) then ! high clouds 698 698 iz=3 699 else if(p1.ge.(440._wp*100._wp) . and. p1.lt.(680._wp*100._wp)) then ! mid clouds699 else if(p1.ge.(440._wp*100._wp) .AND. p1.lt.(680._wp*100._wp)) then ! mid clouds 700 700 iz=2 701 701 endif … … 748 748 749 749 ! Avoid zero values 750 if( (cldy(i,ncol,nlev).eq.1.) . and. (ATBperp(i,ncol,nlev).gt.0.) )then750 if( (cldy(i,ncol,nlev).eq.1.) .AND. (ATBperp(i,ncol,nlev).gt.0.) )then 751 751 ! Computation of the ATBperp along the phase discrimination line 752 752 ATBperp_tmp = (ATB(i,ncol,nlev)**5)*alpha50 + (ATB(i,ncol,nlev)**4)*beta50 + & … … 767 767 ! to classify the phase cloud 768 768 cldlayphase(i,ncol,4,2) = 1. ! tot cloud 769 if (p1 .gt. 0. . and. p1.lt.(440._wp*100._wp)) then ! high cloud769 if (p1 .gt. 0. .AND. p1.lt.(440._wp*100._wp)) then ! high cloud 770 770 cldlayphase(i,ncol,3,2) = 1._wp 771 else if(p1 .ge. (440._wp*100._wp) . and. p1 .lt. (680._wp*100._wp)) then ! mid cloud771 else if(p1 .ge. (440._wp*100._wp) .AND. p1 .lt. (680._wp*100._wp)) then ! mid cloud 772 772 cldlayphase(i,ncol,2,2) = 1._wp 773 773 else ! low cloud … … 776 776 cldlayphase(i,ncol,4,5) = 1._wp ! tot cloud 777 777 ! High cloud 778 if (p1 .gt. 0. . and. p1 .lt. (440._wp*100._wp)) then778 if (p1 .gt. 0. .AND. p1 .lt. (440._wp*100._wp)) then 779 779 cldlayphase(i,ncol,3,5) = 1._wp 780 780 ! Middle cloud 781 else if(p1 .ge. (440._wp*100._wp) . and. p1 .lt. (680._wp*100._wp)) then781 else if(p1 .ge. (440._wp*100._wp) .AND. p1 .lt. (680._wp*100._wp)) then 782 782 cldlayphase(i,ncol,2,5) = 1._wp 783 783 ! Low cloud … … 791 791 cldlayphase(i,ncol,4,1) = 1._wp ! tot cloud 792 792 ! High cloud 793 if (p1 .gt. 0. . and. p1 .lt. (440._wp*100._wp)) then793 if (p1 .gt. 0. .AND. p1 .lt. (440._wp*100._wp)) then 794 794 cldlayphase(i,ncol,3,1) = 1._wp 795 795 ! Middle cloud 796 else if(p1 .ge. (440._wp*100._wp) . and. p1 .lt. (680._wp*100._wp)) then796 else if(p1 .ge. (440._wp*100._wp) .AND. p1 .lt. (680._wp*100._wp)) then 797 797 cldlayphase(i,ncol,2,1) = 1._wp 798 798 ! Low cloud … … 811 811 cldlayphase(i,ncol,4,2) = 1._wp ! tot cloud 812 812 ! High cloud 813 if (p1 .gt. 0. . and. p1 .lt. (440._wp*100._wp)) then813 if (p1 .gt. 0. .AND. p1 .lt. (440._wp*100._wp)) then 814 814 cldlayphase(i,ncol,3,2) = 1._wp 815 815 ! Middle cloud 816 else if(p1 .ge. (440._wp*100._wp) . and. p1 .lt. (680._wp*100._wp)) then816 else if(p1 .ge. (440._wp*100._wp) .AND. p1 .lt. (680._wp*100._wp)) then 817 817 cldlayphase(i,ncol,2,2) = 1._wp 818 818 ! Low cloud … … 827 827 cldlayphase(i,ncol,4,4) = 1._wp ! tot cloud 828 828 ! High cloud 829 if (p1 .gt. 0. . and. p1 .lt. (440._wp*100._wp)) then829 if (p1 .gt. 0. .AND. p1 .lt. (440._wp*100._wp)) then 830 830 cldlayphase(i,ncol,3,4) = 1._wp 831 831 ! Middle cloud 832 else if(p1 .ge. (440._wp*100._wp) . and. p1 .lt. (680._wp*100._wp)) then832 else if(p1 .ge. (440._wp*100._wp) .AND. p1 .lt. (680._wp*100._wp)) then 833 833 cldlayphase(i,ncol,2,4) = 1._wp 834 834 ! Low cloud … … 838 838 cldlayphase(i,ncol,4,1) = 1._wp ! tot cloud 839 839 ! High cloud 840 if (p1 .gt. 0. . and. p1 .lt. (440._wp*100._wp)) then840 if (p1 .gt. 0. .AND. p1 .lt. (440._wp*100._wp)) then 841 841 cldlayphase(i,ncol,3,1) = 1._wp 842 842 ! Middle cloud 843 else if(p1 .ge. (440._wp*100._wp) . and. p1 .lt. (680._wp*100._wp)) then843 else if(p1 .ge. (440._wp*100._wp) .AND. p1 .lt. (680._wp*100._wp)) then 844 844 cldlayphase(i,ncol,2,1) = 1._wp 845 845 ! Low cloud … … 859 859 p1 = pplay(i,nlev) 860 860 861 if((cldy(i,ncol,nlev) .eq. 1.) . and. (ATBperp(i,ncol,nlev) .gt. 0.) )then861 if((cldy(i,ncol,nlev) .eq. 1.) .AND. (ATBperp(i,ncol,nlev) .gt. 0.) )then 862 862 ! Computation of the ATBperp of the phase discrimination line 863 863 ATBperp_tmp = (ATB(i,ncol,nlev)**5)*alpha50 + (ATB(i,ncol,nlev)**4)*beta50 + & … … 875 875 cldlayphase(i,ncol,4,2) = 1._wp ! tot cloud 876 876 ! High cloud 877 if (p1 .gt. 0. . and. p1 .lt. (440._wp*100._wp)) then877 if (p1 .gt. 0. .AND. p1 .lt. (440._wp*100._wp)) then 878 878 cldlayphase(i,ncol,3,2) = 1._wp 879 879 ! Middle cloud 880 else if(p1 .ge. (440._wp*100._wp) . and. p1 .lt. (680._wp*100._wp)) then880 else if(p1 .ge. (440._wp*100._wp) .AND. p1 .lt. (680._wp*100._wp)) then 881 881 cldlayphase(i,ncol,2,2) = 1._wp 882 882 ! Low cloud … … 887 887 cldlayphase(i,ncol,4,5) = 1. ! tot cloud 888 888 ! High cloud 889 if (p1 .gt. 0. . and. p1 .lt. (440._wp*100._wp)) then889 if (p1 .gt. 0. .AND. p1 .lt. (440._wp*100._wp)) then 890 890 cldlayphase(i,ncol,3,5) = 1._wp 891 891 ! Middle cloud 892 else if(p1 .ge. (440._wp*100._wp) . and. p1 .lt. (680._wp*100._wp)) then892 else if(p1 .ge. (440._wp*100._wp) .AND. p1 .lt. (680._wp*100._wp)) then 893 893 cldlayphase(i,ncol,2,5) = 1._wp 894 894 ! Low cloud … … 902 902 cldlayphase(i,ncol,4,1) = 1._wp ! tot cloud 903 903 ! High cloud 904 if (p1 .gt. 0. . and. p1 .lt. (440._wp*100._wp)) then904 if (p1 .gt. 0. .AND. p1 .lt. (440._wp*100._wp)) then 905 905 cldlayphase(i,ncol,3,1) = 1._wp 906 906 ! Middle cloud 907 else if(p1 .ge. (440._wp*100._wp) . and. p1 .lt.(680._wp*100._wp)) then907 else if(p1 .ge. (440._wp*100._wp) .AND. p1 .lt.(680._wp*100._wp)) then 908 908 cldlayphase(i,ncol,2,1) = 1._wp 909 909 ! Low cloud … … 923 923 cldlayphase(i,ncol,4,2) = 1._wp ! tot cloud 924 924 ! High cloud 925 if (p1 .gt. 0. . and. p1 .lt. (440._wp*100._wp)) then925 if (p1 .gt. 0. .AND. p1 .lt. (440._wp*100._wp)) then 926 926 cldlayphase(i,ncol,3,2) = 1._wp 927 927 ! Middle cloud 928 else if(p1 .ge. (440._wp*100._wp) . and. p1 .lt. (680._wp*100._wp)) then928 else if(p1 .ge. (440._wp*100._wp) .AND. p1 .lt. (680._wp*100._wp)) then 929 929 cldlayphase(i,ncol,2,2) = 1._wp 930 930 ! Low cloud … … 939 939 cldlayphase(i,ncol,4,4) = 1._wp ! tot cloud 940 940 ! High cloud 941 if (p1 .gt. 0. . and. p1 .lt. (440._wp*100._wp)) then941 if (p1 .gt. 0. .AND. p1 .lt. (440._wp*100._wp)) then 942 942 cldlayphase(i,ncol,3,4) = 1._wp 943 943 ! Middle 944 else if(p1 .ge. (440._wp*100._wp) . and. p1 .lt. (680._wp*100._wp)) then944 else if(p1 .ge. (440._wp*100._wp) .AND. p1 .lt. (680._wp*100._wp)) then 945 945 cldlayphase(i,ncol,2,4) = 1._wp 946 946 ! Low cloud … … 951 951 cldlayphase(i,ncol,4,1) = 1._wp ! tot cloud 952 952 ! High cloud 953 if (p1 .gt. 0. . and. p1 .lt. (440._wp*100._wp)) then953 if (p1 .gt. 0. .AND. p1 .lt. (440._wp*100._wp)) then 954 954 cldlayphase(i,ncol,3,1) = 1._wp 955 955 ! Middle cloud 956 else if(p1 .ge. (440._wp*100._wp) . and. p1 .lt. (680._wp*100._wp)) then956 else if(p1 .ge. (440._wp*100._wp) .AND. p1 .lt. (680._wp*100._wp)) then 957 957 cldlayphase(i,ncol,2,1) = 1._wp 958 958 ! Low cloud … … 986 986 cldlayphase(i,ncol,4,3) = 1._wp ! tot cloud 987 987 ! High cloud 988 if (p1 .gt. 0. . and. p1 .lt. (440._wp*100._wp)) then988 if (p1 .gt. 0. .AND. p1 .lt. (440._wp*100._wp)) then 989 989 cldlayphase(i,ncol,3,3) = 1._wp 990 990 ! Middle cloud 991 else if(p1 .ge. (440._wp*100._wp) . and. p1 .lt. (680._wp*100._wp)) then991 else if(p1 .ge. (440._wp*100._wp) .AND. p1 .lt. (680._wp*100._wp)) then 992 992 cldlayphase(i,ncol,2,3) = 1._wp 993 993 ! Low cloud … … 1087 1087 DO itemp=1,Ntemp 1088 1088 if(tmpi(i,ncol,nlev).gt.0.)then 1089 if((tmpi(i,ncol,nlev) .ge. tempmod(itemp)) . and. (tmpi(i,ncol,nlev) .lt. tempmod(itemp+1)) )then1089 if((tmpi(i,ncol,nlev) .ge. tempmod(itemp)) .AND. (tmpi(i,ncol,nlev) .lt. tempmod(itemp+1)) )then 1090 1090 lidarcldtemp(i,itemp,2)=lidarcldtemp(i,itemp,2)+1._wp 1091 1091 endif 1092 1092 elseif(tmpl(i,ncol,nlev) .gt. 0.)then 1093 if((tmpl(i,ncol,nlev) .ge. tempmod(itemp)) . and. (tmpl(i,ncol,nlev) .lt. tempmod(itemp+1)) )then1093 if((tmpl(i,ncol,nlev) .ge. tempmod(itemp)) .AND. (tmpl(i,ncol,nlev) .lt. tempmod(itemp+1)) )then 1094 1094 lidarcldtemp(i,itemp,3)=lidarcldtemp(i,itemp,3)+1._wp 1095 1095 endif 1096 1096 elseif(tmpu(i,ncol,nlev) .gt. 0.)then 1097 if((tmpu(i,ncol,nlev) .ge. tempmod(itemp)) . and. (tmpu(i,ncol,nlev) .lt. tempmod(itemp+1)) )then1097 if((tmpu(i,ncol,nlev) .ge. tempmod(itemp)) .AND. (tmpu(i,ncol,nlev) .lt. tempmod(itemp+1)) )then 1098 1098 lidarcldtemp(i,itemp,4)=lidarcldtemp(i,itemp,4)+1._wp 1099 1099 endif … … 1193 1193 DO k=1,Nlevels 1194 1194 ! Cloud detection at subgrid-scale: 1195 where ((x(:,:,k) .gt. S_cld) . and. (x(:,:,k) .ne. undef) )1195 where ((x(:,:,k) .gt. S_cld) .AND. (x(:,:,k) .ne. undef) ) 1196 1196 cldy(:,:,k)=1._wp 1197 1197 elsewhere … … 1200 1200 1201 1201 ! Number of usefull sub-columns: 1202 where ((x(:,:,k) .gt. S_att) . and. (x(:,:,k) .ne. undef) )1202 where ((x(:,:,k) .gt. S_att) .AND. (x(:,:,k) .ne. undef) ) 1203 1203 srok(:,:,k)=1._wp 1204 1204 elsewhere … … 1216 1216 iz=1 1217 1217 p1 = pplay(ip,k) 1218 if ( p1.gt.0. . and. p1.lt.(440._wp*100._wp)) then ! high clouds1218 if ( p1.gt.0. .AND. p1.lt.(440._wp*100._wp)) then ! high clouds 1219 1219 iz=3 1220 else if(p1.ge.(440._wp*100._wp) . and. p1.lt.(680._wp*100._wp)) then ! mid clouds1220 else if(p1.ge.(440._wp*100._wp) .AND. p1.lt.(680._wp*100._wp)) then ! mid clouds 1221 1221 iz=2 1222 1222 endif … … 1344 1344 DO k=1,Nlevels 1345 1345 ! Cloud detection at subgrid-scale: 1346 where ( (x(:,:,k) .gt. S_cld) . and. (x(:,:,k) .ne. undef) )1346 where ( (x(:,:,k) .gt. S_cld) .AND. (x(:,:,k) .ne. undef) ) 1347 1347 cldy(:,:,k)=1._wp 1348 1348 elsewhere … … 1350 1350 endwhere 1351 1351 ! Fully attenuated layer detection at subgrid-scale: 1352 where ( (x(:,:,k) .lt. S_att_opaq) . and. (x(:,:,k) .ge. 0.) .and. (x(:,:,k) .ne. undef) ) !DEBUG1352 where ( (x(:,:,k) .lt. S_att_opaq) .AND. (x(:,:,k) .ge. 0.) .AND. (x(:,:,k) .ne. undef) ) !DEBUG 1353 1353 cldyopaq(:,:,k)=1._wp 1354 1354 elsewhere … … 1358 1358 1359 1359 ! Number of usefull sub-column layers: 1360 where ( (x(:,:,k) .gt. S_att) . and. (x(:,:,k) .ne. undef) )1360 where ( (x(:,:,k) .gt. S_att) .AND. (x(:,:,k) .ne. undef) ) 1361 1361 srok(:,:,k)=1._wp 1362 1362 elsewhere … … 1364 1364 endwhere 1365 1365 ! Number of usefull sub-columns layers for z_opaque 3D fraction: 1366 where ( (x(:,:,k) .ge. 0.) . and. (x(:,:,k) .ne. undef) ) !DEBUG1366 where ( (x(:,:,k) .ge. 0.) .AND. (x(:,:,k) .ne. undef) ) !DEBUG 1367 1367 srokopaq(:,:,k)=1._wp 1368 1368 elsewhere … … 1397 1397 1398 1398 ! Declaring non-opaque cloudy profiles as thin cloud profiles 1399 if ( cldlay(ip,ic,4).gt. 0. . and. cldlay(ip,ic,1) .eq. 0. ) then1399 if ( cldlay(ip,ic,4).gt. 0. .AND. cldlay(ip,ic,1) .eq. 0. ) then 1400 1400 cldlay(ip,ic,2) = 1._wp 1401 1401 endif … … 1410 1410 ! Declaring z_opaque altitude and opaque cloud fraction for 3D and 2D variables 1411 1411 ! From SFC-2-TOA ( actually from vgrid_z(SFC+1) = vgrid_z(Nlevels-1) ) 1412 if ( cldy(ip,ic,Nlevels-k) .eq. 1. . and. zopac .eq. 0. ) then1412 if ( cldy(ip,ic,Nlevels-k) .eq. 1. .AND. zopac .eq. 0. ) then 1413 1413 lidarcldtype(ip,Nlevels-k + 1,3) = lidarcldtype(ip,Nlevels-k + 1,3) + 1._wp 1414 1414 cldlay(ip,ic,3) = vgrid_z(Nlevels-k+1) ! z_opaque altitude … … 1442 1442 ! Declaring thin cloud fraction for 3D variable 1443 1443 ! From TOA-2-SFC 1444 if ( cldy(ip,ic,k) .eq. 1. . and. topcloud .eq. 1. ) then1444 if ( cldy(ip,ic,k) .eq. 1. .AND. topcloud .eq. 1. ) then 1445 1445 lidarcldtype(ip,k,2) = lidarcldtype(ip,k,2) + 1._wp 1446 1446 z_base = k ! bottom cloud layer 1447 1447 endif 1448 if ( cldy(ip,ic,k) .eq. 1. . and. topcloud .eq. 0. ) then1448 if ( cldy(ip,ic,k) .eq. 1. .AND. topcloud .eq. 0. ) then 1449 1449 lidarcldtype(ip,k,2) = lidarcldtype(ip,k,2) + 1._wp 1450 1450 z_top = k ! top cloud layer … … 1458 1458 cloudemis = 0._wp 1459 1459 DO k=z_base+1,Nlevels 1460 if ( (x(ip,ic,k) .gt. S_att_opaq) . and. (x(ip,ic,k) .lt. 1.0) .and. (x(ip,ic,k) .ne. undef) ) then1460 if ( (x(ip,ic,k) .gt. S_att_opaq) .AND. (x(ip,ic,k) .lt. 1.0) .AND. (x(ip,ic,k) .ne. undef) ) then 1461 1461 srmean = srmean + x(ip,ic,k) 1462 1462 srcount = srcount + 1. … … 1502 1502 DO ip = 1, Npoints 1503 1503 DO k = 2, Nlevels 1504 if ( (lidarcldtype(ip,k,3) .ne. undef) . and. (lidarcldtype(ip,k-1,4) .ne. undef) ) then1504 if ( (lidarcldtype(ip,k,3) .ne. undef) .AND. (lidarcldtype(ip,k-1,4) .ne. undef) ) then 1505 1505 lidarcldtype(ip,k,4) = lidarcldtype(ip,k,3) + lidarcldtype(ip,k-1,4) 1506 1506 else -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lmdz_cosp_interface.F90
r5160 r5185 311 311 312 312 !!! Ici on modifie les cles logiques pour les outputs selon les champs actives dans les .xml 313 if ((itap.ge.1). and.(first_write))then313 if ((itap.ge.1).AND.(first_write))then 314 314 IF (using_xios) call read_xiosfieldactive(cfg) 315 315 first_write=.false. … … 344 344 cfg%Lisccp, cfg%Lmisr, cfg%Lmodis, cfg%Lrttov 345 345 346 endif !(itap.gt.1). and.(first_write)346 endif !(itap.gt.1).AND.(first_write) 347 347 348 348 time_bnds(1) = dtime-dtime/2. -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lmdz_cosp_output_write_mod.F90
r5158 r5185 389 389 ! do k=1,PARASOL_NREFL 390 390 ! do ip=1, Npoints 391 ! if (stlidar%cldlayer(ip,4).gt.1. and.stlidar%parasolrefl(ip,k).ne.missing_val) then391 ! if (stlidar%cldlayer(ip,4).gt.1.AND.stlidar%parasolrefl(ip,k).ne.missing_val) then 392 392 ! parasolcrefl(ip,k)=(stlidar%parasolrefl(ip,k)-0.03*(1.-stlidar%cldlayer(ip,4)/100.))/ & 393 393 ! (stlidar%cldlayer(ip,4)/100.) … … 470 470 471 471 !!! Sorties combinees Cloudsat et Calipso 472 if (cfg%Lcalipso . and. cfg%Lcloudsat) then472 if (cfg%Lcalipso .AND. cfg%Lcloudsat) then 473 473 474 474 if (cfg%Lclcalipso2) then -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lmdz_cosp_subsample_and_optics_mod.F90
r5158 r5185 361 361 DO i=1,nPoints 362 362 DO j=1,nLevels 363 if (cospIN%rcfg_cloudsat%use_gas_abs == 1 .or. (cospIN%rcfg_cloudsat%use_gas_abs == 2 . and. j .eq. 1)) then363 if (cospIN%rcfg_cloudsat%use_gas_abs == 1 .or. (cospIN%rcfg_cloudsat%use_gas_abs == 2 .AND. j .eq. 1)) then 364 364 g_vol(i,j) = gases(cospstateIN%pfull(i,j), cospstateIN%at(i,j),cospstateIN%qv(i,j),cospIN%rcfg_cloudsat%freq) 365 365 endif -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/modis_simulator.F90
r5158 r5185 223 223 end if 224 224 end do 225 where((retrievedSize(1:nSubCols) < 0.). and.(retrievedSize(1:nSubCols) /= R_UNDEF)) &225 where((retrievedSize(1:nSubCols) < 0.).AND.(retrievedSize(1:nSubCols) /= R_UNDEF)) & 226 226 retrievedSize(1:nSubCols) = 1.0e-06_wp*re_fill 227 227 … … 229 229 ! mimics what MODIS does to first order. 230 230 ! Of course, ISCCP cloud top pressures are in mb. 231 where(cloudMask(1:nSubCols) . and. retrievedCloudTopPressure(1:nSubCols) > CO2Slicing_PressureLimit) &231 where(cloudMask(1:nSubCols) .AND. retrievedCloudTopPressure(1:nSubCols) > CO2Slicing_PressureLimit) & 232 232 retrievedCloudTopPressure(1:nSubCols) = isccpCloudTopPressure! * 100._wp 233 233 … … 297 297 ! ######################################################################################## 298 298 validRetrievalMask(1:nPoints,1:nSubCols) = particle_size(1:nPoints,1:nSubCols) > 0. 299 cloudMask(1:nPoints,1:nSubCols) = phase(1:nPoints,1:nSubCols) /= phaseIsNone . and. &299 cloudMask(1:nPoints,1:nSubCols) = phase(1:nPoints,1:nSubCols) /= phaseIsNone .AND. & 300 300 validRetrievalMask(1:nPoints,1:nSubCols) 301 waterCloudMask(1:nPoints,1:nSubCols) = phase(1:nPoints,1:nSubCols) == phaseIsLiquid . and. &301 waterCloudMask(1:nPoints,1:nSubCols) = phase(1:nPoints,1:nSubCols) == phaseIsLiquid .AND. & 302 302 validRetrievalMask(1:nPoints,1:nSubCols) 303 iceCloudMask(1:nPoints,1:nSubCols) = phase(1:nPoints,1:nSubCols) == phaseIsIce . and. &303 iceCloudMask(1:nPoints,1:nSubCols) = phase(1:nPoints,1:nSubCols) == phaseIsIce .AND. & 304 304 validRetrievalMask(1:nPoints,1:nSubCols) 305 305 … … 310 310 Cloud_Fraction_Water_Mean(1:nPoints) = real(count(waterCloudMask, dim = 2)) 311 311 Cloud_Fraction_Ice_Mean(1:nPoints) = real(count(iceCloudMask, dim = 2)) 312 Cloud_Fraction_High_Mean(1:nPoints) = real(count(cloudMask . and. cloud_top_pressure <= &312 Cloud_Fraction_High_Mean(1:nPoints) = real(count(cloudMask .AND. cloud_top_pressure <= & 313 313 highCloudPressureLimit, dim = 2)) 314 Cloud_Fraction_Low_Mean(1:nPoints) = real(count(cloudMask . and. cloud_top_pressure > &314 Cloud_Fraction_Low_Mean(1:nPoints) = real(count(cloudMask .AND. cloud_top_pressure > & 315 315 lowCloudPressureLimit, dim = 2)) 316 316 Cloud_Fraction_Mid_Mean(1:nPoints) = Cloud_Fraction_Total_Mean(1:nPoints) - Cloud_Fraction_High_Mean(1:nPoints)& -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/parasol.F90
r5158 r5185 118 118 DO it=1,PARASOL_NREFL 119 119 DO ny=1,PARASOL_NTAU-1 120 WHERE (tautot_S(1:npoints) .ge. PARASOL_TAU(ny). and. &120 WHERE (tautot_S(1:npoints) .ge. PARASOL_TAU(ny).AND. & 121 121 tautot_S(1:npoints) .le. PARASOL_TAU(ny+1)) 122 122 rlumA_mod(1:npoints,it) = aA(it,ny)*tautot_S(1:npoints) + bA(it,ny) -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/prec_scops.F90
r5158 r5185 200 200 endif 201 201 enddo ! loop over ncol 202 if ((flag_ls .eq. 0) . and. (ilev .lt. nlev)) then ! possibility THREE202 if ((flag_ls .eq. 0) .AND. (ilev .lt. nlev)) then ! possibility THREE 203 203 DO ibox=1,ncol 204 204 if (frac_out(j,ibox,ilev+1) .eq. 1) then … … 236 236 endif 237 237 enddo ! loop over ncol 238 if ((flag_cv .eq. 0) . and. (ilev .lt. nlev)) then ! possibility THREE238 if ((flag_cv .eq. 0) .AND. (ilev .lt. nlev)) then ! possibility THREE 239 239 DO ibox=1,ncol 240 240 if (frac_out(j,ibox,ilev+1) .eq. 2) then -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/quickbeam.F90
r5158 r5185 179 179 180 180 ! Attenuation due to gaseous absorption between radar and volume 181 if ((rcfg%use_gas_abs == 1) .or. (rcfg%use_gas_abs == 2 . and. pr .eq. 1)) then181 if ((rcfg%use_gas_abs == 1) .or. (rcfg%use_gas_abs == 2 .AND. pr .eq. 1)) then 182 182 if (d_gate==1) then 183 183 if (k>1) then … … 402 402 DO pr=1,Ncolumns 403 403 ! 1) Compute the PIA in all profiles containing hydrometeors 404 if ( (Ze_non_out(i,pr,cloudsat_preclvl).gt.-100) . and. (Ze_out(i,pr,cloudsat_preclvl).gt.-100) ) then405 if ( (Ze_non_out(i,pr,cloudsat_preclvl).lt.100) . and. (Ze_out(i,pr,cloudsat_preclvl).lt.100) ) then404 if ( (Ze_non_out(i,pr,cloudsat_preclvl).gt.-100) .AND. (Ze_out(i,pr,cloudsat_preclvl).gt.-100) ) then 405 if ( (Ze_non_out(i,pr,cloudsat_preclvl).lt.100) .AND. (Ze_out(i,pr,cloudsat_preclvl).lt.100) ) then 406 406 cloudsat_precip_pia(i,pr) = Ze_non_out(i,pr,cloudsat_preclvl) - Ze_out(i,pr,cloudsat_preclvl) 407 407 endif … … 419 419 cloudsat_pflag(i,pr) = pClass_Snow2 ! TSL: Snow certain 420 420 endif 421 if(Ze_non_out(i,pr,cloudsat_preclvl).gt.Zenonbinval(4). and. &421 if(Ze_non_out(i,pr,cloudsat_preclvl).gt.Zenonbinval(4).AND. & 422 422 Ze_non_out(i,pr,cloudsat_preclvl).le.Zenonbinval(2)) then 423 423 cloudsat_pflag(i,pr) = pClass_Snow1 ! TSL: Snow possible … … 426 426 427 427 ! Mixed 428 if(fracPrecipIce(i,pr).gt.0.1. and.fracPrecipIce(i,pr).le.0.9) then428 if(fracPrecipIce(i,pr).gt.0.1.AND.fracPrecipIce(i,pr).le.0.9) then 429 429 if(Ze_non_out(i,pr,cloudsat_preclvl).gt.Zenonbinval(2)) then 430 430 cloudsat_pflag(i,pr) = pClass_Mixed2 ! TSL: Mixed certain 431 431 endif 432 if(Ze_non_out(i,pr,cloudsat_preclvl).gt.Zenonbinval(4). and. &432 if(Ze_non_out(i,pr,cloudsat_preclvl).gt.Zenonbinval(4).AND. & 433 433 Ze_non_out(i,pr,cloudsat_preclvl).le.Zenonbinval(2)) then 434 434 cloudsat_pflag(i,pr) = pClass_Mixed1 ! TSL: Mixed possible … … 441 441 cloudsat_pflag(i,pr) = pClass_Rain3 ! TSL: Rain certain 442 442 endif 443 if(Ze_non_out(i,pr,cloudsat_preclvl).gt.Zenonbinval(3). and. &443 if(Ze_non_out(i,pr,cloudsat_preclvl).gt.Zenonbinval(3).AND. & 444 444 Ze_non_out(i,pr,cloudsat_preclvl).le.Zenonbinval(1)) then 445 445 cloudsat_pflag(i,pr) = pClass_Rain2 ! TSL: Rain probable 446 446 endif 447 if(Ze_non_out(i,pr,cloudsat_preclvl).gt.Zenonbinval(4). and. &447 if(Ze_non_out(i,pr,cloudsat_preclvl).gt.Zenonbinval(4).AND. & 448 448 Ze_non_out(i,pr,cloudsat_preclvl).le.Zenonbinval(3)) then 449 449 cloudsat_pflag(i,pr) = pClass_Rain1 ! TSL: Rain possible … … 472 472 cloudsat_pflag(i,pr) = pClass_Snow2 ! JEK: Snow certain 473 473 endif 474 if(Ze_out(i,pr,cloudsat_preclvl) .gt. Zbinvallnd(6) . and. &474 if(Ze_out(i,pr,cloudsat_preclvl) .gt. Zbinvallnd(6) .AND. & 475 475 Ze_out(i,pr,cloudsat_preclvl).le.Zbinvallnd(5)) then 476 476 cloudsat_pflag(i,pr) = pClass_Snow1 ! JEK: Snow possible … … 479 479 480 480 ! Mized phase (273<T<275) 481 if(t2m(i) .ge. 273._wp . and. t2m(i) .le. 275._wp) then482 if ((Zmax .gt. Zbinvallnd(1) . and. cloudsat_precip_pia(i,pr).gt.30) .or. &481 if(t2m(i) .ge. 273._wp .AND. t2m(i) .le. 275._wp) then 482 if ((Zmax .gt. Zbinvallnd(1) .AND. cloudsat_precip_pia(i,pr).gt.30) .or. & 483 483 (Ze_out(i,pr,cloudsat_preclvl) .gt. Zbinvallnd(4))) then 484 484 cloudsat_pflag(i,pr) = pClass_Mixed2 ! JEK: Mixed certain 485 485 endif 486 if ((Ze_out(i,pr,cloudsat_preclvl) .gt. Zbinvallnd(6) . and. &487 Ze_out(i,pr,cloudsat_preclvl) .le. Zbinvallnd(4)) . and. &486 if ((Ze_out(i,pr,cloudsat_preclvl) .gt. Zbinvallnd(6) .AND. & 487 Ze_out(i,pr,cloudsat_preclvl) .le. Zbinvallnd(4)) .AND. & 488 488 (Zmax .gt. Zbinvallnd(5)) ) then 489 489 cloudsat_pflag(i,pr) = pClass_Mixed1 ! JEK: Mixed possible … … 493 493 ! Rain (T>275) 494 494 if(t2m(i) .gt. 275) then 495 if ((Zmax .gt. Zbinvallnd(1) . and. cloudsat_precip_pia(i,pr).gt.30) .or. &495 if ((Zmax .gt. Zbinvallnd(1) .AND. cloudsat_precip_pia(i,pr).gt.30) .or. & 496 496 (Ze_out(i,pr,cloudsat_preclvl) .gt. Zbinvallnd(2))) then 497 497 cloudsat_pflag(i,pr) = pClass_Rain3 ! JEK: Rain certain 498 498 endif 499 if((Ze_out(i,pr,cloudsat_preclvl) .gt. Zbinvallnd(6)) . and. &499 if((Ze_out(i,pr,cloudsat_preclvl) .gt. Zbinvallnd(6)) .AND. & 500 500 (Zmax .gt. Zbinvallnd(3))) then 501 501 cloudsat_pflag(i,pr) = pClass_Rain2 ! JEK: Rain probable 502 502 endif 503 if((Ze_out(i,pr,cloudsat_preclvl) .gt. Zbinvallnd(6)) . and. &503 if((Ze_out(i,pr,cloudsat_preclvl) .gt. Zbinvallnd(6)) .AND. & 504 504 (Zmax.lt.Zbinvallnd(3))) then 505 505 cloudsat_pflag(i,pr) = pClass_Rain1 ! JEK: Rain possible … … 536 536 537 537 ! Normalize by number of subcolumns 538 where ((cloudsat_precip_cover /= R_UNDEF). and.(cloudsat_precip_cover /= 0.0)) &538 where ((cloudsat_precip_cover /= R_UNDEF).AND.(cloudsat_precip_cover /= 0.0)) & 539 539 cloudsat_precip_cover = cloudsat_precip_cover / Ncolumns 540 where ((cloudsat_pia/= R_UNDEF). and.(cloudsat_pia/= 0.0)) &540 where ((cloudsat_pia/= R_UNDEF).AND.(cloudsat_pia/= 0.0)) & 541 541 cloudsat_pia = cloudsat_pia / Ncolumns 542 542 -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/quickbeam_optics.F90
r5158 r5185 145 145 hydro = .false. 146 146 DO j=1,rcfg%nhclass 147 if ((hm_matrix(pr,k,j) > 1E-12) . and. (sd%dtype(j) > 0)) then147 if ((hm_matrix(pr,k,j) > 1E-12) .AND. (sd%dtype(j) > 0)) then 148 148 hydro = .true. 149 149 exit … … 217 217 ! Use Ze_scaled, Zr_scaled, and kr_scaled ... if know them 218 218 ! if not we will calculate Ze, Zr, and Kr from the distribution parameters 219 ! if( rcfg%Z_scale_flag(tp,itt,iRe_type) . and. .not. DO_LUT_TEST) then219 ! if( rcfg%Z_scale_flag(tp,itt,iRe_type) .AND. .not. DO_LUT_TEST) then 220 220 ! ! can use z scaling 221 221 ! scale_factor=rho_a*hm_matrix(pr,k,tp) … … 272 272 else 273 273 ! I assume here that water phase droplets are spheres. 274 ! sd%rho should be ~ 1000 or sd%apm=524 . and. sd%bpm=3274 ! sd%rho should be ~ 1000 or sd%apm=524 .AND. sd%bpm=3 275 275 Deq = Di 276 276 endif … … 292 292 ! NOTE: if .not. DO_LUT_TEST, then you are checking the LUT approximation 293 293 ! not just the DSD representation given by Ni 294 if(Np_matrix(pr,k,tp)>0 . and. DO_NP_TEST ) then294 if(Np_matrix(pr,k,tp)>0 .AND. DO_NP_TEST ) then 295 295 Np = path_integral(Ni,Di,1,ns-1)/rho_a*1.E6_wp 296 296 ! Note: Representation is not great or small Re < 2 … … 305 305 ! LUT test code 306 306 ! This segment of code compares full calculation to scaling result 307 if ( rcfg%Z_scale_flag(tp,itt,iRe_type) . and. DO_LUT_TEST ) then307 if ( rcfg%Z_scale_flag(tp,itt,iRe_type) .AND. DO_LUT_TEST ) then 308 308 scale_factor=rho_a*hm_matrix(pr,k,tp) 309 309 ! if more than 2 dBZe difference print error message/parameters. … … 398 398 399 399 ! If density is constant, set equivalent values for apm and bpm 400 if ((rho_c > 0) . and. (apm < 0)) then400 if ((rho_c > 0) .AND. (apm < 0)) then 401 401 apm = (pi/6)*rho_c 402 402 bpm = 3._wp … … 405 405 ! Exponential is same as modified gamma with vu =1 406 406 ! if Np is specified then we will just treat as modified gamma 407 if(dtype .eq. 2 . and. Np .gt. 0) then407 if(dtype .eq. 2 .AND. Np .gt. 0) then 408 408 local_dtype = 1 409 409 local_p3 = 1 … … 441 441 endif 442 442 443 if( Np.eq.0 . and. p2+1 > 1E-8) then ! use default value for MEAN diameter as first default443 if( Np.eq.0 .AND. p2+1 > 1E-8) then ! use default value for MEAN diameter as first default 444 444 dm = p2 ! by definition, should have units of microns 445 445 D0 = gamma(vu)/gamma(vu+1)*dm … … 525 525 526 526 ! get rg ... 527 if( Np.eq.0 . and. (abs(p2+1) > 1E-8) ) then ! use default value of rg527 if( Np.eq.0 .AND. (abs(p2+1) > 1E-8) ) then ! use default value of rg 528 528 rg = p2 529 529 else … … 640 640 641 641 ! If density is constant, store equivalent values for apm and bpm 642 if ((rho_c > 0) . and. (apm < 0)) then642 if ((rho_c > 0) .AND. (apm < 0)) then 643 643 apm = (pi/6)*rho_c 644 644 bpm = 3._wp … … 648 648 ! if only Np given then calculate Re 649 649 ! if neigher than use other defaults (p1,p2,p3) following quickbeam documentation 650 if(Re==0 . and. Np>0) then650 if(Re==0 .AND. Np>0) then 651 651 call calc_Re(Q,Np,rho_a,dtype,apm,bpm,rho_c,p1,p2,p3,Re) 652 652 endif … … 754 754 if (tc < -30) then 755 755 bhp = -1.75_wp+0.09_wp*((tc+273._wp)-243.16_wp) 756 elseif ((tc >= -30) . and. (tc < -9)) then756 elseif ((tc >= -30) .AND. (tc < -9)) then 757 757 bhp = -3.25_wp-0.06_wp*((tc+273._wp)-265.66_wp) 758 758 else … … 764 764 if (tc < -35) then 765 765 bhp = -1.75_wp+0.09_wp*((tc+273._wp)-243.16_wp) 766 elseif ((tc >= -35) . and. (tc < -17.5)) then766 elseif ((tc >= -35) .AND. (tc < -17.5)) then 767 767 bhp = -2.65_wp+0.09_wp*((tc+273._wp)-255.66_wp) 768 elseif ((tc >= -17.5) . and. (tc < -9)) then768 elseif ((tc >= -17.5) .AND. (tc < -9)) then 769 769 bhp = -3.25_wp-0.06_wp*((tc+273._wp)-265.66_wp) 770 770 else … … 969 969 970 970 correct_for_rho = 0 971 if ((ice == 1) . and. (minval(rho_e) >= 0)) correct_for_rho = 1971 if ((ice == 1) .AND. (minval(rho_e) >= 0)) correct_for_rho = 1 972 972 973 973 ! Correct refractive index for ice density if needed -
LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/scops.F90
r5158 r5185 75 75 76 76 ! Test for valid input overlap assumption 77 if (overlap .ne. 1 . and. overlap .ne. 2 .and. overlap .ne. 3) then77 if (overlap .ne. 1 .AND. overlap .ne. 2 .AND. overlap .ne. 3) then 78 78 overlap=default_overlap 79 79 call errorMessage('ERROR(scops): Invalid overlap assumption provided. Using default overlap assumption (max/ran)') … … 180 180 !threshold_min(1:npoints,ibox) = max(conv(1:npoints,ilev),min(tca(1:npoints,ilev-1),tca(1:npoints,ilev))) 181 181 !maxosc(1:npoints,ibox) = merge(1,0,threshold(1:npoints,ibox) .lt. & 182 ! min(tca(1:npoints,ilev-1),tca(1:npoints,ilev)) . and. &182 ! min(tca(1:npoints,ilev-1),tca(1:npoints,ilev)) .AND. & 183 183 ! (threshold(1:npoints,ibox).gt.conv(1:npoints,ilev))) 184 184 if (ilev .ne. 1) then 185 185 threshold_min(1:npoints,ibox) = max(conv(1:npoints,ilev),min(tca(1:npoints,ilev-1),tca(1:npoints,ilev))) 186 186 maxosc(1:npoints,ibox) = merge(1,0,threshold(1:npoints,ibox) .lt. & 187 min(tca(1:npoints,ilev-1),tca(1:npoints,ilev)) . and. &187 min(tca(1:npoints,ilev-1),tca(1:npoints,ilev)) .AND. & 188 188 (threshold(1:npoints,ibox).gt.conv(1:npoints,ilev))) 189 189 else 190 190 threshold_min(1:npoints,ibox) = max(conv(1:npoints,ilev),min(0._wp,tca(1:npoints,ilev))) 191 191 maxosc(1:npoints,ibox) = merge(1,0,threshold(1:npoints,ibox) .lt. & 192 min(0._wp,tca(1:npoints,ilev)) . and. &192 min(0._wp,tca(1:npoints,ilev)) .AND. & 193 193 (threshold(1:npoints,ibox).gt.conv(1:npoints,ilev))) 194 194 endif … … 208 208 209 209 ! Code to partition boxes into startiform and convective parts goes here 210 where(threshold(1:npoints,ibox).le.conv(1:npoints,ilev) . and. conv(1:npoints,ilev).gt.0.) frac_out(1:npoints,ibox,ilev)=2210 where(threshold(1:npoints,ibox).le.conv(1:npoints,ilev) .AND. conv(1:npoints,ilev).gt.0.) frac_out(1:npoints,ibox,ilev)=2 211 211 ENDDO ! ibox 212 212 -
LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/lmdz_infotrac.f90
r5184 r5185 1 link ../../dyn3d_common/ infotrac.F901 link ../../dyn3d_common/lmdz_infotrac.f90 -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad.v1.5.1/abor1.F90
r5159 r5185 23 23 ! FLUSH not understood by NAG compiler 24 24 !CALL FLUSH(NULOUT) 25 IF (NULOUT /= 0 . and. NULOUT /= 6) CLOSE(NULOUT)25 IF (NULOUT /= 0 .AND. NULOUT /= 6) CLOSE(NULOUT) 26 26 ENDIF 27 27 -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad.v1.5.1/easy_netcdf.F90
r5159 r5185 763 763 DO j = 1, ndims 764 764 n = n * ndimlens(j) 765 if (j > 1 . and. ndimlens(j) > 1) then765 if (j > 1 .AND. ndimlens(j) > 1) then 766 766 write(nulerr,'(a,a,a)') '*** Error reading NetCDF variable ', & 767 767 & var_name, & … … 821 821 DO j = 1, ndims 822 822 n = n * ndimlens(j) 823 if (j > 1 . and. ndimlens(j) > 1) then823 if (j > 1 .AND. ndimlens(j) > 1) then 824 824 write(nulerr,'(a,a,a)') '*** Error reading NetCDF variable ', & 825 825 & var_name, & … … 880 880 DO j = 1, ndims 881 881 n = n * ndimlens(j) 882 if (j > 1 . and. ndimlens(j) > 1) then882 if (j > 1 .AND. ndimlens(j) > 1) then 883 883 write(nulerr,'(a,a,a)') '*** Error reading NetCDF variable ', & 884 884 & var_name, & … … 940 940 DO j = 1, ndims-1 941 941 n = n * ndimlens(j) 942 if (j > 1 . and. ndimlens(j) > 1) then942 if (j > 1 .AND. ndimlens(j) > 1) then 943 943 write(nulerr,'(a,a,a)') '*** Error reading 1D slice from NetCDF variable ', & 944 944 & var_name, & … … 1023 1023 DO j = 1, ndims 1024 1024 ntotal = ntotal * ndimlens(j) 1025 if (j > 2 . and. ndimlens(j) > 1) then1025 if (j > 2 .AND. ndimlens(j) > 1) then 1026 1026 write(nulerr,'(a,a,a)') '*** Error reading NetCDF variable ', & 1027 1027 & var_name, & … … 1135 1135 DO j = 1, ndims 1136 1136 ntotal = ntotal * ndimlens(j) 1137 if (j > 2 . and. ndimlens(j) > 1) then1137 if (j > 2 .AND. ndimlens(j) > 1) then 1138 1138 write(nulerr,'(a,a,a)') '*** Error reading NetCDF variable ', & 1139 1139 & var_name, & … … 1254 1254 DO j = 1, ndims-1 1255 1255 ntotal = ntotal * ndimlens(j) 1256 if (j > 2 . and. ndimlens(j) > 1) then1256 if (j > 2 .AND. ndimlens(j) > 1) then 1257 1257 write(nulerr,'(a,a,a)') '*** Error reading 2D slice from NetCDF variable ', & 1258 1258 & var_name, & … … 1378 1378 DO j = 1, ndims 1379 1379 ntotal = ntotal * ndimlens(j) 1380 if (j > 3 . and. ndimlens(j) > 1) then1380 if (j > 3 .AND. ndimlens(j) > 1) then 1381 1381 write(nulerr,'(a,a,a)') '*** Error reading NetCDF variable ', & 1382 1382 & var_name, & … … 1514 1514 DO j = 1, ndims-1 1515 1515 ntotal = ntotal * ndimlens(j) 1516 if (j > 3 . and. ndimlens(j) > 1) then1516 if (j > 3 .AND. ndimlens(j) > 1) then 1517 1517 write(nulerr,'(a,a,a)') '*** Error reading 3D slice from NetCDF variable ', & 1518 1518 & var_name, & … … 1656 1656 DO j = 1, ndims 1657 1657 ntotal = ntotal * ndimlens(j) 1658 if (j > 4 . and. ndimlens(j) > 1) then1658 if (j > 4 .AND. ndimlens(j) > 1) then 1659 1659 write(nulerr,'(a,a,a)') '*** Error reading NetCDF variable ', & 1660 1660 & var_name, & … … 1987 1987 end if 1988 1988 1989 if (present(dim1_name) . and. ndims_input >= 1) then1989 if (present(dim1_name) .AND. ndims_input >= 1) then 1990 1990 ! Variable is at least one dimensional 1991 1991 ndims_local = 1 … … 1996 1996 call my_abort('Error writing NetCDF file') 1997 1997 end if 1998 if (present(dim2_name) . and. ndims_input >= 2) then1998 if (present(dim2_name) .AND. ndims_input >= 2) then 1999 1999 ! Variable is at least two dimensional 2000 2000 ndims_local = 2 … … 2005 2005 call my_abort('Error writing NetCDF file') 2006 2006 end if 2007 if (present(dim3_name) . and. ndims_input >= 3) then2007 if (present(dim3_name) .AND. ndims_input >= 3) then 2008 2008 ! Variable is at least three dimensional 2009 2009 ndims_local = 3 … … 2014 2014 call my_abort('Error writing NetCDF file') 2015 2015 end if 2016 if (present(dim4_name) . and. ndims_input >= 4) then2016 if (present(dim4_name) .AND. ndims_input >= 4) then 2017 2017 ! Variable is at least three dimensional 2018 2018 ndims_local = 4 … … 2472 2472 ! Check the total size of the variable to be stored (but receiving 2473 2473 ! ntotal is zero then there must be an unlimited dimension) 2474 if (ntotal /= size(var,kind=jpib) . and. ntotal /= 0) then2474 if (ntotal /= size(var,kind=jpib) .AND. ntotal /= 0) then 2475 2475 write(nulerr,'(a,i0,a,a,a,i0)') '*** Error: attempt to write matrix of total size ', & 2476 2476 & nvarlen, ' to ', var_name, ' which has total size ', ntotal … … 2551 2551 write(var_slice_name,'(a,a,i0,a)') var_name, '(:,:,', index3, ')' 2552 2552 end if 2553 if (ntotal /= size(var,kind=jpib) . and. ntotal /= 0) then2553 if (ntotal /= size(var,kind=jpib) .AND. ntotal /= 0) then 2554 2554 write(nulerr,'(a,i0,a,a,a,i0)') '*** Error: attempt to write matrix of total size ', & 2555 2555 & nvarlen, ' to ', trim(var_slice_name), ' which has total size ', ntotal -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad.v1.5.1/radiation_aerosol_optics.F90
r5159 r5185 290 290 else 291 291 iwn = 1 292 DO while (wavenumber(iwn+1) < wavenumber_target . and. iwn < nwn-1)292 DO while (wavenumber(iwn+1) < wavenumber_target .AND. iwn < nwn-1) 293 293 iwn = iwn + 1 294 294 end do … … 703 703 iband = config%i_band_from_reordered_g_sw(jg) 704 704 local_od = od_sw(jg,jlev,jcol) + od_sw_aerosol(iband) 705 if (local_od > 0.0_jprb . and. od_sw_aerosol(iband) > 0.0_jprb) then705 if (local_od > 0.0_jprb .AND. od_sw_aerosol(iband) > 0.0_jprb) then 706 706 local_scat = ssa_sw(jg,jlev,jcol) * od_sw(jg,jlev,jcol) & 707 707 & + scat_sw_aerosol(iband) … … 728 728 iband = config%i_band_from_reordered_g_lw(jg) 729 729 local_od = od_lw(jg,jlev,jcol) + od_lw_aerosol(iband) 730 if (local_od > 0.0_jprb . and. od_lw_aerosol(iband) > 0.0_jprb) then730 if (local_od > 0.0_jprb .AND. od_lw_aerosol(iband) > 0.0_jprb) then 731 731 ! All scattering is due to aerosols, therefore the 732 732 ! asymmetry factor is equal to the value for aerosols -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad.v1.5.1/radiation_aerosol_optics_data.F90
r5159 r5185 373 373 end if 374 374 375 if (n_type_philic > 0 . and. nrh > 0) then375 if (n_type_philic > 0 .AND. nrh > 0) then 376 376 if (n_bands_sw > 0) then 377 377 allocate(this%mass_ext_sw_philic(n_bands_sw, nrh, n_type_philic)) -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad.v1.5.1/radiation_aerosol_optics_description.F90
r5159 r5185 140 140 ! Check if we have a match 141 141 if (to_string(this%code_philic(:,ja)) == code_str & 142 & . and. to_string(this%optical_model_philic(1:len(optical_model_str),ja)) &142 & .AND. to_string(this%optical_model_philic(1:len(optical_model_str),ja)) & 143 143 & == optical_model_str) then 144 144 this%is_preferred_philic(ja) = .true. … … 148 148 DO ja = 1,size(this%bin_phobic) 149 149 if (to_string(this%code_phobic(:,ja)) == code_str & 150 & . and. to_string(this%optical_model_phobic(1:len(optical_model_str),ja)) &150 & .AND. to_string(this%optical_model_phobic(1:len(optical_model_str),ja)) & 151 151 & == optical_model_str) then 152 152 this%is_preferred_phobic(ja) = .true. … … 211 211 if (to_string(this%code_philic(:,ja)) == code_str) then 212 212 ! Aerosol code matches 213 if (present(ibin) . and. this%bin_philic(ja) > 0) then213 if (present(ibin) .AND. this%bin_philic(ja) > 0) then 214 214 if (ibin > 0) then 215 215 if (ibin == this%bin_philic(ja)) then … … 243 243 current_score = current_score + 2 244 244 end if 245 if (current_score > 0 . and. this%is_preferred_philic(ja)) then245 if (current_score > 0 .AND. this%is_preferred_philic(ja)) then 246 246 current_score = current_score + 1 247 247 end if … … 251 251 score = current_score 252 252 is_ambiguous = .false. 253 else if (current_score > 0 . and. current_score == score) then253 else if (current_score > 0 .AND. current_score == score) then 254 254 is_ambiguous = .true. 255 255 end if … … 262 262 if (to_string(this%code_phobic(:,ja)) == code_str) then 263 263 ! Aerosol code matches 264 if (present(ibin) . and. this%bin_phobic(ja) > 0) then264 if (present(ibin) .AND. this%bin_phobic(ja) > 0) then 265 265 if (ibin > 0) then 266 266 if (ibin == this%bin_phobic(ja)) then … … 294 294 current_score = current_score + 2 295 295 end if 296 if (current_score > 0 . and. this%is_preferred_phobic(ja)) then296 if (current_score > 0 .AND. this%is_preferred_phobic(ja)) then 297 297 current_score = current_score + 1 298 298 end if … … 302 302 score = current_score 303 303 is_ambiguous = .false. 304 else if (current_score > 0 . and. current_score == score) then304 else if (current_score > 0 .AND. current_score == score) then 305 305 is_ambiguous = .true. 306 306 end if -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad.v1.5.1/radiation_check.F90
r5159 r5185 48 48 if (allocated(var)) then 49 49 50 if (present(i1) . and. present(i2)) then50 if (present(i1) .AND. present(i2)) then 51 51 varmin = minval(var(i1:i2)) 52 52 varmax = maxval(var(i1:i2)) … … 62 62 is_bad = .true. 63 63 if (do_fix) then 64 if (present(i1) . and. present(i2)) then64 if (present(i1) .AND. present(i2)) then 65 65 var(i1:i2) = max(boundmin, min(boundmax, var(i1:i2))) 66 66 else … … 105 105 if (allocated(var)) then 106 106 107 if (present(i1) . and. present(i2)) then107 if (present(i1) .AND. present(i2)) then 108 108 ii1 = i1 109 109 ii2 = i2 … … 112 112 ii2 = ubound(var,1) 113 113 end if 114 if (present(j1) . and. present(j2)) then114 if (present(j1) .AND. present(j2)) then 115 115 jj1 = j1 116 116 jj2 = j2 … … 168 168 if (allocated(var)) then 169 169 170 if (present(i1) . and. present(i2)) then170 if (present(i1) .AND. present(i2)) then 171 171 ii1 = i1 172 172 ii2 = i2 … … 175 175 ii2 = ubound(var,1) 176 176 end if 177 if (present(j1) . and. present(j2)) then177 if (present(j1) .AND. present(j2)) then 178 178 jj1 = j1 179 179 jj2 = j2 … … 182 182 jj2 = ubound(var,2) 183 183 end if 184 if (present(k1) . and. present(k2)) then184 if (present(k1) .AND. present(k2)) then 185 185 kk1 = k1 186 186 kk2 = k2 -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad.v1.5.1/radiation_cloud_generator.F90
r5159 r5185 213 213 trigger = rand_top(jg) * total_cloud_cover 214 214 jlev = ibegin 215 DO while (trigger > cum_cloud_cover(jlev) . and. jlev < iend)215 DO while (trigger > cum_cloud_cover(jlev) .AND. jlev < iend) 216 216 jlev = jlev + 1 217 217 end do … … 689 689 690 690 ! For each spectral interval, has the first cloud appeared at this level? 691 first_cloud(jg) = (trigger(jg) <= cum_cloud_cover(jlev) . and. .not. found_cloud(jg))691 first_cloud(jg) = (trigger(jg) <= cum_cloud_cover(jlev) .AND. .not. found_cloud(jg)) 692 692 693 693 ! ...if so, add to found_cloud … … 699 699 ! prev_cloud) 700 700 is_cloud(jg) = first_cloud(jg) & 701 & .or. found_cloud(jg) . and. merge(rand_cloud(jg,jlev)*frac(jlev-1) &701 & .or. found_cloud(jg) .AND. merge(rand_cloud(jg,jlev)*frac(jlev-1) & 702 702 & < frac(jlev)+frac(jlev-1)-pair_cloud_cover(jlev-1), & 703 703 & rand_cloud(jg,jlev)*(cum_cloud_cover(jlev-1) - frac(jlev-1)) & … … 712 712 rand_inhom(jg,jlev) = merge(merge(rand_inhom(jg,jlev-1), rand_inhom(jg,jlev), & 713 713 & rand_inhom2(jg,jlev) < overlap_param_inhom(jlev-1) & 714 & . and. prev_cloud(jg)), &714 & .AND. prev_cloud(jg)), & 715 715 & 0.0_jprb, is_cloud(jg)) 716 716 end do -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad.v1.5.1/radiation_cloud_optics.F90
r5159 r5185 138 138 end if 139 139 else if (config%i_ice_model == IIceModelBaran & 140 & . and. size(config%cloud_optics%ice_coeff_lw, 2) &140 & .AND. size(config%cloud_optics%ice_coeff_lw, 2) & 141 141 & /= NIceOpticsCoeffsBaran) then 142 142 write(nulerr,'(a,i0,a,i0,a,i0,a)') & … … 146 146 call radiation_abort() 147 147 else if (config%i_ice_model == IIceModelBaran2016 & 148 & . and. size(config%cloud_optics%ice_coeff_lw, 2) &148 & .AND. size(config%cloud_optics%ice_coeff_lw, 2) & 149 149 & /= NIceOpticsCoeffsBaran2016) then 150 150 write(nulerr,'(a,i0,a,i0,a,i0,a)') & -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad.v1.5.1/radiation_config.F90
r5159 r5185 809 809 do_weighted_surface_mapping = this%do_weighted_surface_mapping 810 810 811 if (present(file_name) . and. present(unit)) then811 if (present(file_name) .AND. present(unit)) then 812 812 write(nulerr,'(a)') '*** Error: cannot specify both file_name and unit in call to config_type%read' 813 813 call radiation_abort('Radiation configuration error') 814 else if (.not. present(file_name) . and. .not. present(unit)) then814 else if (.not. present(file_name) .AND. .not. present(unit)) then 815 815 write(nulerr,'(a)') '*** Error: neither file_name nor unit specified in call to config_type%read' 816 816 call radiation_abort('Radiation configuration error') … … 1007 1007 1008 1008 ! Will clouds be used at all? 1009 if ((this%do_sw . and. this%i_solver_sw /= ISolverCloudless) &1010 & .or. (this%do_lw . and. this%i_solver_lw /= ISolverCloudless)) then1009 if ((this%do_sw .AND. this%i_solver_sw /= ISolverCloudless) & 1010 & .or. (this%do_lw .AND. this%i_solver_lw /= ISolverCloudless)) then 1011 1011 this%do_clouds = .true. 1012 1012 else … … 1015 1015 1016 1016 if (this%i_gas_model == IGasModelIFSRRTMG & 1017 & . and. (this%use_general_cloud_optics &1017 & .AND. (this%use_general_cloud_optics & 1018 1018 & .or. this%use_general_aerosol_optics)) then 1019 if (this%do_sw . and. this%do_cloud_aerosol_per_sw_g_point) then1019 if (this%do_sw .AND. this%do_cloud_aerosol_per_sw_g_point) then 1020 1020 write(nulout,'(a)') 'Warning: RRTMG SW only supports cloud/aerosol/surface optical properties per band, not per g-point' 1021 1021 this%do_cloud_aerosol_per_sw_g_point = .false. 1022 1022 end if 1023 if (this%do_lw . and. this%do_cloud_aerosol_per_lw_g_point) then1023 if (this%do_lw .AND. this%do_cloud_aerosol_per_lw_g_point) then 1024 1024 write(nulout,'(a)') 'Warning: RRTMG LW only supports cloud/aerosol/surface optical properties per band, not per g-point' 1025 1025 this%do_cloud_aerosol_per_lw_g_point = .false. … … 1055 1055 1056 1056 ! Check consistency of models 1057 if (this%do_canopy_fluxes_sw . and. .not. this%do_surface_sw_spectral_flux) then1057 if (this%do_canopy_fluxes_sw .AND. .not. this%do_surface_sw_spectral_flux) then 1058 1058 if (this%iverbosesetup >= 1) then 1059 1059 write(nulout,'(a)') 'Warning: turning on do_surface_sw_spectral_flux as required by do_canopy_fluxes_sw' … … 1063 1063 1064 1064 ! Will clouds be used at all? 1065 if ((this%do_sw . and. this%i_solver_sw /= ISolverCloudless) &1066 & .or. (this%do_lw . and. this%i_solver_lw /= ISolverCloudless)) then1065 if ((this%do_sw .AND. this%i_solver_sw /= ISolverCloudless) & 1066 & .or. (this%do_lw .AND. this%i_solver_lw /= ISolverCloudless)) then 1067 1067 this%do_clouds = .true. 1068 1068 else … … 1075 1075 & .or. this%i_solver_sw == ISolverTripleclouds & 1076 1076 & .or. this%i_solver_lw == ISolverTripleclouds) & 1077 & . and. this%i_overlap_scheme /= IOverlapExponentialRandom) then1077 & .AND. this%i_overlap_scheme /= IOverlapExponentialRandom) then 1078 1078 write(nulerr,'(a)') '*** Error: SPARTACUS/Tripleclouds solvers can only do Exponential-Random overlap' 1079 1079 call radiation_abort('Radiation configuration error') 1080 1080 end if 1081 1081 1082 if (jprb < jprd . and. this%iverbosesetup >= 1 &1083 & . and. (this%i_solver_sw == ISolverSPARTACUS &1082 if (jprb < jprd .AND. this%iverbosesetup >= 1 & 1083 & .AND. (this%i_solver_sw == ISolverSPARTACUS & 1084 1084 & .or. this%i_solver_lw == ISolverSPARTACUS)) then 1085 1085 write(nulout,'(a)') 'Warning: the SPARTACUS solver may be unstable in single precision' … … 1213 1213 end if 1214 1214 1215 if (this%use_aerosols . and. this%n_aerosol_types == 0) then1215 if (this%use_aerosols .AND. this%n_aerosol_types == 0) then 1216 1216 if (this%iverbosesetup >= 2) then 1217 1217 write(nulout, '(a)') 'Aerosols on but n_aerosol_types=0: optical properties to be computed outside ecRad' … … 1232 1232 end if 1233 1233 1234 if (this%i_solver_sw == ISolverSPARTACUS . and. this%do_sw_delta_scaling_with_gases) then1234 if (this%i_solver_sw == ISolverSPARTACUS .AND. this%do_sw_delta_scaling_with_gases) then 1235 1235 write(nulerr,'(a)') '*** Error: SW delta-Eddington scaling with gases not possible with SPARTACUS solver' 1236 1236 call radiation_abort('Radiation configuration error') 1237 1237 end if 1238 1238 1239 if ((this%do_lw . and. this%do_sw) .and. &1239 if ((this%do_lw .AND. this%do_sw) .AND. & 1240 1240 & ( ( this%i_solver_sw == ISolverHomogeneous & 1241 & . and. this%i_solver_lw /= ISolverHomogeneous) &1241 & .AND. this%i_solver_lw /= ISolverHomogeneous) & 1242 1242 & .or. ( this%i_solver_sw /= ISolverHomogeneous & 1243 & . and. this%i_solver_lw == ISolverHomogeneous) &1243 & .AND. this%i_solver_lw == ISolverHomogeneous) & 1244 1244 & ) ) then 1245 1245 write(nulerr,'(a)') '*** Error: if one solver is "Homogeneous" then the other must be' … … 1249 1249 ! Set is_homogeneous if the active solvers are homogeneous, since 1250 1250 ! this affects how "in-cloud" water contents are computed 1251 if ( (this%do_sw . and. this%i_solver_sw == ISolverHomogeneous) &1252 & .or. (this%do_lw . and. this%i_solver_lw == ISolverHomogeneous)) then1251 if ( (this%do_sw .AND. this%i_solver_sw == ISolverHomogeneous) & 1252 & .or. (this%do_lw .AND. this%i_solver_lw == ISolverHomogeneous)) then 1253 1253 this%is_homogeneous = .true. 1254 1254 end if … … 1568 1568 & wavelength1, ' to ', wavelength2, ' m is outside shortwave band' 1569 1569 call radiation_abort('Radiation configuration error') 1570 else if (this%iverbosesetup >= 2 . and. present(weighting_name)) then1570 else if (this%iverbosesetup >= 2 .AND. present(weighting_name)) then 1571 1571 write(nulout,'(a,a,a,f6.0,a,f6.0,a)') 'Spectral weights for ', & 1572 1572 & weighting_name, ' (', wavenumber1, ' to ', & -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad.v1.5.1/radiation_ecckd.F90
r5159 r5185 441 441 442 442 ! Rayleigh scattering 443 if (this%is_sw . and. present(rayleigh_od_fl)) then443 if (this%is_sw .AND. present(rayleigh_od_fl)) then 444 444 DO jlev = 1,nlev 445 445 rayleigh_od_fl(:,jlev,jcol) = global_multiplier & -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad.v1.5.1/radiation_flux.F90
r5159 r5185 361 361 if (lhook) call dr_hook('radiation_flux:calc_surface_spectral',0,hook_handle) 362 362 363 if (config%do_sw . and. config%do_surface_sw_spectral_flux) then363 if (config%do_sw .AND. config%do_surface_sw_spectral_flux) then 364 364 365 365 if (use_indexed_sum_vec) then … … 420 420 421 421 ! Fluxes in bands required for canopy radiative transfer 422 if (config%do_sw . and. config%do_canopy_fluxes_sw) then422 if (config%do_sw .AND. config%do_canopy_fluxes_sw) then 423 423 if (config%use_canopy_full_spectrum_sw) then 424 424 this%sw_dn_diffuse_surf_canopy(:,istartcol:iendcol) = this%sw_dn_diffuse_surf_g(:,istartcol:iendcol) … … 472 472 end if ! do_canopy_fluxes_sw 473 473 474 if (config%do_lw . and. config%do_canopy_fluxes_lw) then474 if (config%do_lw .AND. config%do_canopy_fluxes_lw) then 475 475 if (config%use_canopy_full_spectrum_lw) then 476 476 this%lw_dn_surf_canopy(:,istartcol:iendcol) = this%lw_dn_surf_g(:,istartcol:iendcol) -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad.v1.5.1/radiation_gas.F90
r5159 r5185 379 379 if (this%is_present(igas)) then 380 380 if (iunits == IMassMixingRatio & 381 & . and. this%iunits(igas) == IVolumeMixingRatio) then381 & .AND. this%iunits(igas) == IVolumeMixingRatio) then 382 382 sf = sf * GasMolarMass(igas) / AirMolarMass 383 383 else if (iunits == IVolumeMixingRatio & 384 & . and. this%iunits(igas) == IMassMixingRatio) then384 & .AND. this%iunits(igas) == IMassMixingRatio) then 385 385 sf = sf * AirMolarMass / GasMolarMass(igas) 386 386 end if … … 506 506 else 507 507 if (iunits == IMassMixingRatio & 508 & . and. this%iunits(igas) == IVolumeMixingRatio) then508 & .AND. this%iunits(igas) == IVolumeMixingRatio) then 509 509 sf = sf * GasMolarMass(igas) / AirMolarMass 510 510 else if (iunits == IVolumeMixingRatio & 511 & . and. this%iunits(igas) == IMassMixingRatio) then511 & .AND. this%iunits(igas) == IMassMixingRatio) then 512 512 sf = sf * AirMolarMass / GasMolarMass(igas) 513 513 end if -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad.v1.5.1/radiation_homogeneous_lw.F90
r5159 r5185 221 221 & / od_total 222 222 end where 223 where (ssa_total > 0.0_jprb . and. od_total > 0.0_jprb)223 where (ssa_total > 0.0_jprb .AND. od_total > 0.0_jprb) 224 224 g_total = (g(:,jlev,jcol)*ssa(:,jlev,jcol)*od(:,jlev,jcol) & 225 225 & + g_cloud(config%i_band_from_reordered_g_lw,jlev,jcol) & … … 233 233 & * od_cloud_g / od_total 234 234 end where 235 where (ssa_total > 0.0_jprb . and. od_total > 0.0_jprb)235 where (ssa_total > 0.0_jprb .AND. od_total > 0.0_jprb) 236 236 g_total = g_cloud(config%i_band_from_reordered_g_lw,jlev,jcol) & 237 237 & * ssa_cloud(config%i_band_from_reordered_g_lw,jlev,jcol) & -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad.v1.5.1/radiation_homogeneous_sw.F90
r5159 r5185 244 244 & / od_total 245 245 end where 246 where (ssa_total > 0.0_jprb . and. od_total > 0.0_jprb)246 where (ssa_total > 0.0_jprb .AND. od_total > 0.0_jprb) 247 247 g_total = (g(:,jlev,jcol)*ssa(:,jlev,jcol)*od(:,jlev,jcol) & 248 248 & + g_cloud(config%i_band_from_reordered_g_sw,jlev,jcol) & -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad.v1.5.1/radiation_ifs_rrtm.F90
r5159 r5185 639 639 DO jcol = istartcol,iendcol 640 640 temperature = thermodynamics%temperature_hl(jcol,jlev+ilevoffset) 641 if (temperature < 339.0_jprb . and. temperature >= 160.0_jprb) then641 if (temperature < 339.0_jprb .AND. temperature >= 160.0_jprb) then 642 642 ! Linear interpolation between -113 and 66 degC 643 643 ind(jcol) = int(temperature - 159.0_jprb) … … 765 765 DO jcol = istartcol,iendcol 766 766 Tsurf = temperature(jcol) 767 if (Tsurf < 339.0_jprb . and. Tsurf >= 160.0_jprb) then767 if (Tsurf < 339.0_jprb .AND. Tsurf >= 160.0_jprb) then 768 768 ! Linear interpolation between -113 and 66 degC 769 769 ind(jcol) = int(Tsurf - 159.0_jprb) -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad.v1.5.1/radiation_ifs_rrtm.F90.or
r3908 r5185 626 626 do jcol = istartcol,iendcol 627 627 temperature = thermodynamics%temperature_hl(jcol,jlev+ilevoffset) 628 if (temperature < 339.0_jprb . and. temperature >= 160.0_jprb) then628 if (temperature < 339.0_jprb .AND. temperature >= 160.0_jprb) then 629 629 ! Linear interpolation between -113 and 66 degC 630 630 ind(jcol) = int(temperature - 159.0_jprb) … … 749 749 do jcol = istartcol,iendcol 750 750 Tsurf = temperature(jcol) 751 if (Tsurf < 339.0_jprb . and. Tsurf >= 160.0_jprb) then751 if (Tsurf < 339.0_jprb .AND. Tsurf >= 160.0_jprb) then 752 752 ! Linear interpolation between -113 and 66 degC 753 753 ind(jcol) = int(Tsurf - 159.0_jprb) -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad.v1.5.1/radiation_interface.F90
r5159 r5185 100 100 ! solver_lw as they will be needed. 101 101 if (config%do_lw_cloud_scattering & 102 & . and. config%i_solver_lw == ISolverMcICA) then102 & .AND. config%i_solver_lw == ISolverMcICA) then 103 103 config%n_g_lw_if_scattering = config%n_g_lw 104 104 end if … … 381 381 ! a NetCDF file 382 382 if (config%do_save_radiative_properties) then 383 if (istartcol == 1 . and. iendcol == ncol) then383 if (istartcol == 1 .AND. iendcol == ncol) then 384 384 rad_prop_file_name = rad_prop_base_file_name // ".nc" 385 385 else -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad.v1.5.1/radiation_save.F90
r5159 r5185 86 86 87 87 if (config%i_gas_model == IGasModelMonochromatic & 88 . and. config%mono_lw_wavelength > 0.0_jprb) then88 .AND. config%mono_lw_wavelength > 0.0_jprb) then 89 89 lw_units_str = 'W m-3' 90 90 else … … 126 126 end if 127 127 128 if (config%do_lw . and. config%do_canopy_fluxes_lw) then128 if (config%do_lw .AND. config%do_canopy_fluxes_lw) then 129 129 call out_file%define_dimension("canopy_band_lw", & 130 130 & size(flux%lw_dn_surf_canopy, 1)) 131 131 end if 132 if (config%do_sw . and. config%do_canopy_fluxes_sw) then132 if (config%do_sw .AND. config%do_canopy_fluxes_sw) then 133 133 call out_file%define_dimension("canopy_band_sw", & 134 134 & size(flux%sw_dn_diffuse_surf_canopy, 1)) … … 302 302 end if 303 303 304 if (config%do_lw . and. config%do_clouds) then304 if (config%do_lw .AND. config%do_clouds) then 305 305 call out_file%define_variable("cloud_cover_lw", & 306 306 & dim1_name="column", units_str="1", & … … 308 308 & standard_name="cloud_area_fraction") 309 309 end if 310 if (config%do_sw . and. config%do_clouds) then310 if (config%do_sw .AND. config%do_clouds) then 311 311 call out_file%define_variable("cloud_cover_sw", & 312 312 & dim1_name="column", units_str="1", & … … 398 398 end if 399 399 400 if (config%do_lw . and. config%do_clouds) then400 if (config%do_lw .AND. config%do_clouds) then 401 401 call out_file%put("cloud_cover_lw", flux%cloud_cover_lw) 402 402 end if 403 if (config%do_sw . and. config%do_clouds) then403 if (config%do_sw .AND. config%do_clouds) then 404 404 call out_file%put("cloud_cover_sw", flux%cloud_cover_sw) 405 405 end if … … 538 538 & units_str="Pa", long_name="Pressure on half-levels") 539 539 540 if (allocated(thermodynamics%h2o_sat_liq) . and. config%use_aerosols) then540 if (allocated(thermodynamics%h2o_sat_liq) .AND. config%use_aerosols) then 541 541 call out_file%define_variable("q_sat_liquid", & 542 542 & dim2_name="column", dim1_name="level", & … … 653 653 call out_file%put("pressure_hl", thermodynamics%pressure_hl(istartcol:iendcol,:)) 654 654 655 if (allocated(thermodynamics%h2o_sat_liq) . and. config%use_aerosols) then655 if (allocated(thermodynamics%h2o_sat_liq) .AND. config%use_aerosols) then 656 656 call out_file%put("q_sat_liquid", thermodynamics%h2o_sat_liq(istartcol:iendcol,:)) 657 657 end if … … 774 774 nlev = nlev - 1 775 775 776 do_aerosol = config%use_aerosols . and. present(aerosol)776 do_aerosol = config%use_aerosols .AND. present(aerosol) 777 777 778 778 ! Open the file … … 869 869 & units_str="1", long_name="Ozone mass mixing ratio") 870 870 DO jgas = 1,NMaxGases 871 if (gas%is_present(jgas) . and. jgas /= IH2O .and. jgas /= IO3) then871 if (gas%is_present(jgas) .AND. jgas /= IH2O .AND. jgas /= IO3) then 872 872 write(var_name,'(a,a)') trim(GasLowerCaseName(jgas)), '_vmr' 873 873 write(long_name,'(a,a)') trim(GasName(jgas)), ' volume mixing ratio' … … 944 944 end if 945 945 call out_file%put("lw_emissivity", single_level%lw_emissivity) 946 if (config%do_clouds . and. allocated(single_level%iseed)) then946 if (config%do_clouds .AND. allocated(single_level%iseed)) then 947 947 allocate(seed(ncol)) 948 948 seed = single_level%iseed … … 960 960 call out_file%put("o3_mmr", mixing_ratio) 961 961 DO jgas = 1,NMaxGases 962 if (gas%is_present(jgas) . and. jgas /= IH2O .and. jgas /= IO3) then962 if (gas%is_present(jgas) .AND. jgas /= IH2O .AND. jgas /= IO3) then 963 963 write(var_name,'(a,a)') trim(GasLowerCaseName(jgas)), '_vmr' 964 964 call gas%get(jgas, IVolumeMixingRatio, mixing_ratio) -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad.v1.5.1/radiation_scheme.F90
r5159 r5185 507 507 & driver_config%high_inv_effective_size, 0.8_jprb, 0.45_jprb) 508 508 ! else if (driver_config%cloud_separation_scale_surface > 0.0_jprb & 509 ! . and. driver_config%cloud_separation_scale_toa > 0.0_jprb) then509 ! .AND. driver_config%cloud_separation_scale_toa > 0.0_jprb) then 510 510 else if (driver_config%ok_separation) then 511 511 call cloud%param_cloud_effective_separation_eta(klon, klev, & -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad.v1.5.1/radiation_single_level.F90
r5159 r5185 310 310 end if 311 311 312 if (config%do_lw . and. present(lw_albedo)) then312 if (config%do_lw .AND. present(lw_albedo)) then 313 313 if (config%use_canopy_full_spectrum_lw) then 314 314 if (config%n_g_lw /= size(this%lw_emissivity,2)) then -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad.v1.5.1/radiation_spartacus_lw.F90
r5159 r5185 421 421 ! region and the sky is overcast then 3D calculations must 422 422 ! be turned off as there will be only one region 423 if (config%do_3d_effects . and. &424 & allocated(cloud%inv_cloud_effective_size) . and. &425 & .not. (nreg == 2 . and. cloud%fraction(jcol,jlev) &423 if (config%do_3d_effects .AND. & 424 & allocated(cloud%inv_cloud_effective_size) .AND. & 425 & .not. (nreg == 2 .AND. cloud%fraction(jcol,jlev) & 426 426 & > 1.0_jprb-config%cloud_fraction_threshold)) then 427 427 if (cloud%inv_cloud_effective_size(jcol,jlev) & … … 586 586 ! 3D effects for any further g-points 587 587 if (ng3D == ng & 588 & . and. od_region(jg,1) > config%max_gas_od_3D) then588 & .AND. od_region(jg,1) > config%max_gas_od_3D) then 589 589 ng3D = jg-1 590 590 end if … … 637 637 ! of the cloud 638 638 if (config%do_lw_side_emissivity & 639 & . and. region_fracs(1,jlev,jcol) > 0.0_jprb .and. region_fracs(2,jlev,jcol) > 0.0_jprb &640 & . and. config%do_3d_effects &641 & . and. cloud%inv_cloud_effective_size(jcol,jlev) > 0.0_jprb) then639 & .AND. region_fracs(1,jlev,jcol) > 0.0_jprb .AND. region_fracs(2,jlev,jcol) > 0.0_jprb & 640 & .AND. config%do_3d_effects & 641 & .AND. cloud%inv_cloud_effective_size(jcol,jlev) > 0.0_jprb) then 642 642 aspect_ratio = 1.0_jprb / (min(cloud%inv_cloud_effective_size(jcol,jlev), & 643 643 & 1.0_jprb / config%min_cloud_effective_size) & … … 894 894 ! source below a layer interface to the equivalent values 895 895 ! just above 896 if (is_clear_sky_layer(jlev) . and. is_clear_sky_layer(jlev-1)) then896 if (is_clear_sky_layer(jlev) .AND. is_clear_sky_layer(jlev-1)) then 897 897 ! If both layers are cloud free, this is trivial... 898 898 total_albedo(:,:,:,jlev) = 0.0_jprb … … 1014 1014 ! Account for overlap rules in translating fluxes just above 1015 1015 ! a layer interface to the values just below 1016 if (is_clear_sky_layer(jlev) . and. is_clear_sky_layer(jlev+1)) then1016 if (is_clear_sky_layer(jlev) .AND. is_clear_sky_layer(jlev+1)) then 1017 1017 flux_dn_below = flux_dn_above 1018 1018 else -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad.v1.5.1/radiation_spartacus_sw.F90
r5159 r5185 494 494 end if 495 495 496 if (config%do_3d_effects . and. &497 & allocated(cloud%inv_cloud_effective_size) . and. &498 & .not. (nreg == 2 . and. cloud%fraction(jcol,jlev) &496 if (config%do_3d_effects .AND. & 497 & allocated(cloud%inv_cloud_effective_size) .AND. & 498 & .not. (nreg == 2 .AND. cloud%fraction(jcol,jlev) & 499 499 & > 1.0-config%cloud_fraction_threshold)) then 500 500 if (cloud%inv_cloud_effective_size(jcol,jlev) > 0.0_jprb) then … … 663 663 ! 3D effects for any further g-points 664 664 if (ng3D == ng & 665 & . and. od_region(jg,1) > config%max_gas_od_3D) then665 & .AND. od_region(jg,1) > config%max_gas_od_3D) then 666 666 ng3D = jg-1 667 667 end if … … 936 936 if ((config%i_3d_sw_entrapment == IEntrapmentExplicitNonFractal & 937 937 & .or. config%i_3d_sw_entrapment == IEntrapmentExplicit) & 938 & . and. jlev >= i_cloud_top) then938 & .AND. jlev >= i_cloud_top) then 939 939 #else 940 940 if (config%i_3d_sw_entrapment == IEntrapmentExplicitNonFractal & … … 970 970 ! Account for cloud overlap when converting albedo and source 971 971 ! below a layer interface to the equivalent values just above 972 if (is_clear_sky_layer(jlev) . and. is_clear_sky_layer(jlev-1)) then972 if (is_clear_sky_layer(jlev) .AND. is_clear_sky_layer(jlev-1)) then 973 973 ! If both layers are cloud free, this is trivial... 974 974 total_albedo(:,:,:,jlev) = 0.0_jprb … … 1218 1218 & / max(config%cloud_fraction_threshold, region_fracs(jreg,jlev,jcol)) 1219 1219 DO jreg4 = 1,nreg ! VIA first lower region (jreg2 is second lower region) 1220 if (.not. (jreg4 == jreg . and. jreg4 /= jreg2)) then1220 if (.not. (jreg4 == jreg .AND. jreg4 /= jreg2)) then 1221 1221 albedo_part(:,jreg3,jreg) = albedo_part(:,jreg3,jreg) + entrapment(:,jreg3,jreg) & 1222 1222 & * v_matrix(jreg4,jreg,jlev,jcol) * total_albedo_below(:,jreg2,jreg4) … … 1306 1306 & / max(config%cloud_fraction_threshold, region_fracs(jreg,jlev,jcol)) 1307 1307 DO jreg4 = 1,nreg 1308 if (.not. (jreg4 == jreg . and. jreg4 /= jreg2)) then1308 if (.not. (jreg4 == jreg .AND. jreg4 /= jreg2)) then 1309 1309 albedo_part(:,jreg3,jreg) = albedo_part(:,jreg3,jreg) + entrapment(:,jreg3,jreg) & 1310 1310 & * v_matrix(jreg4,jreg,jlev,jcol) * total_albedo_below_direct(:,jreg2,jreg4) … … 1330 1330 if ((config%i_3d_sw_entrapment == IEntrapmentExplicitNonFractal & 1331 1331 & .or. config%i_3d_sw_entrapment == IEntrapmentExplicit) & 1332 & . and. .not. (is_clear_sky_layer(jlev) .and. is_clear_sky_layer(jlev-1))) then1332 & .AND. .not. (is_clear_sky_layer(jlev) .AND. is_clear_sky_layer(jlev-1))) then 1333 1333 ! Horizontal migration distances are averaged when 1334 1334 ! applying overlap rules, so equation is … … 1526 1526 ! Account for overlap rules in translating fluxes just above 1527 1527 ! a layer interface to the values just below 1528 if (is_clear_sky_layer(jlev) . and. is_clear_sky_layer(jlev+1)) then1528 if (is_clear_sky_layer(jlev) .AND. is_clear_sky_layer(jlev+1)) then 1529 1529 ! Regions in current layer map directly on to regions in 1530 1530 ! layer below -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad.v1.5.1/radiation_spectral_definition.F90
r5159 r5185 171 171 find_wavenumber = 1 172 172 DO while (wavenumber > this%wavenumber2(find_wavenumber) & 173 & . and. find_wavenumber < this%nwav)173 & .AND. find_wavenumber < this%nwav) 174 174 find_wavenumber = find_wavenumber + 1 175 175 end do … … 250 250 ! will be applicable 251 251 if (wavenumber(jwav) >= this%wavenumber1_band(jband) & 252 & . and. wavenumber(jwav) <= this%wavenumber2_band(jband)) then252 & .AND. wavenumber(jwav) <= this%wavenumber2_band(jband)) then 253 253 if (jwav > 1) then 254 254 wavenum1 = max(this%wavenumber1_band(jband), & … … 388 388 & / (this%wavenumber2(isd1)-this%wavenumber1(isd1)) 389 389 else 390 if (isd2 >= 1 . and. isd2 <= this%nwav) then390 if (isd2 >= 1 .AND. isd2 <= this%nwav) then 391 391 ! Right part of triangle 392 392 weight(isd2) = weight(isd2) + 0.5_jprb * (wavenum2-this%wavenumber1(isd2))**2 & … … 647 647 wavenumber2_bound = 0.01_jprb / wavelength_bound(jint-1) 648 648 where (wavenumber_mid > wavenumber1_bound & 649 & . and. wavenumber_mid <= wavenumber2_bound)649 & .AND. wavenumber_mid <= wavenumber2_bound) 650 650 i_input = i_intervals(jint) 651 651 end where -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad.v1.5.1/radiation_tripleclouds_lw.F90
r5159 r5185 340 340 & / od_total 341 341 end where 342 where (ssa_total > 0.0_jprb . and. od_total > 0.0_jprb)342 where (ssa_total > 0.0_jprb .AND. od_total > 0.0_jprb) 343 343 g_total = (g(:,jlev,jcol)*ssa(:,jlev,jcol)*od(:,jlev,jcol) & 344 344 & + g_cloud(config%i_band_from_reordered_g_lw,jlev,jcol) & … … 352 352 & * od_cloud_new / od_total 353 353 end where 354 where (ssa_total > 0.0_jprb . and. od_total > 0.0_jprb)354 where (ssa_total > 0.0_jprb .AND. od_total > 0.0_jprb) 355 355 g_total = g_cloud(config%i_band_from_reordered_g_lw,jlev,jcol) & 356 356 & * ssa_cloud(config%i_band_from_reordered_g_lw,jlev,jcol) & … … 435 435 ! Account for cloud overlap when converting albedo below a 436 436 ! layer interface to the equivalent values just above 437 if (is_clear_sky_layer(jlev) . and. is_clear_sky_layer(jlev-1)) then437 if (is_clear_sky_layer(jlev) .AND. is_clear_sky_layer(jlev-1)) then 438 438 total_albedo(:,:,jlev) = total_albedo_below(:,:) 439 439 total_source(:,:,jlev) = total_source_below(:,:) … … 534 534 535 535 if (.not. (is_clear_sky_layer(jlev) & 536 & . and. is_clear_sky_layer(jlev+1))) then536 & .AND. is_clear_sky_layer(jlev+1))) then 537 537 ! Account for overlap rules in translating fluxes just above 538 538 ! a layer interface to the values just below -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad.v1.5.1/radiation_tripleclouds_sw.F90
r5159 r5185 18 18 ! 2017-10-23 R. Hogan Renamed single-character variables 19 19 ! 2018-10-08 R. Hogan Call calc_region_properties 20 ! 2019-01-02 R. Hogan Fixed problem of do_save_spectral_flux . and. .not. do_sw_direct20 ! 2019-01-02 R. Hogan Fixed problem of do_save_spectral_flux .AND. .not. do_sw_direct 21 21 ! 2020-09-18 R. Hogan Replaced some array expressions with loops for speed 22 22 … … 395 395 ! Account for cloud overlap when converting albedo below a 396 396 ! layer interface to the equivalent values just above 397 if (is_clear_sky_layer(jlev) . and. is_clear_sky_layer(jlev-1)) then397 if (is_clear_sky_layer(jlev) .AND. is_clear_sky_layer(jlev-1)) then 398 398 total_albedo(:,:,jlev) = total_albedo_below(:,:) 399 399 total_albedo_direct(:,:,jlev) = total_albedo_below_direct(:,:) … … 529 529 530 530 if (.not. (is_clear_sky_layer(jlev) & 531 & . and. is_clear_sky_layer(jlev+1))) then531 & .AND. is_clear_sky_layer(jlev+1))) then 532 532 ! Account for overlap rules in translating fluxes just above 533 533 ! a layer interface to the values just below -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad.v1.5.1/radsurf_save.F90
r5159 r5185 75 75 76 76 if (config%i_gas_model == IGasModelMonochromatic & 77 . and. config%mono_lw_wavelength > 0.0_jprb) then77 .AND. config%mono_lw_wavelength > 0.0_jprb) then 78 78 lw_units_str = 'W m-3' 79 79 else -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/driver/ecrad_driver.F90
r5159 r5185 200 200 end if 201 201 202 if (driver_config%do_save_cloud_optics . and. config%use_general_cloud_optics) then202 if (driver_config%do_save_cloud_optics .AND. config%use_general_cloud_optics) then 203 203 call save_general_cloud_optics(config, 'hydrometeor_optics', iverbose=driver_config%iverbose) 204 204 end if -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/driver/ecrad_driver_config.F90
r5159 r5185 355 355 356 356 if (do_override_eff_size & 357 & . and. (this%high_inv_effective_size_override < 0.0_jprb &357 & .AND. (this%high_inv_effective_size_override < 0.0_jprb & 358 358 .or. this%middle_inv_effective_size_override < 0.0_jprb & 359 359 .or. this%low_inv_effective_size_override < 0.0_jprb)) then -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/driver/ecrad_driver_read_input.F90
r5159 r5185 103 103 else 104 104 single_level%solar_irradiance = 1366.0_jprb 105 if (driver_config%iverbose >= 1 . and. config%do_sw) then105 if (driver_config%iverbose >= 1 .AND. config%do_sw) then 106 106 write(nulout,'(a,g10.3,a)') 'Warning: solar irradiance set to ', & 107 107 & single_level%solar_irradiance, ' W m-2' … … 204 204 ! Optional scaling of liquid water mixing ratio 205 205 if (driver_config%q_liq_scaling >= 0.0_jprb & 206 & . and. driver_config%q_liq_scaling /= 1.0_jprb) then206 & .AND. driver_config%q_liq_scaling /= 1.0_jprb) then 207 207 cloud%q_liq = cloud%q_liq * driver_config%q_liq_scaling 208 208 if (driver_config%iverbose >= 2) then … … 213 213 214 214 ! Optional scaling of ice water mixing ratio 215 if (driver_config%q_ice_scaling >= 0.0_jprb . and. driver_config%q_ice_scaling /= 1.0_jprb) then215 if (driver_config%q_ice_scaling >= 0.0_jprb .AND. driver_config%q_ice_scaling /= 1.0_jprb) then 216 216 cloud%q_ice = cloud%q_ice * driver_config%q_ice_scaling 217 217 if (driver_config%iverbose >= 2) then … … 223 223 ! Optional scaling of cloud fraction 224 224 if (driver_config%cloud_fraction_scaling >= 0.0_jprb & 225 & . and. driver_config%cloud_fraction_scaling /= 1.0_jprb) then225 & .AND. driver_config%cloud_fraction_scaling /= 1.0_jprb) then 226 226 cloud%fraction = cloud%fraction * driver_config%cloud_fraction_scaling 227 227 if (driver_config%iverbose >= 2) then … … 332 332 333 333 else if (driver_config%cloud_separation_scale_surface > 0.0_jprb & 334 & . and. driver_config%cloud_separation_scale_toa > 0.0_jprb) then334 & .AND. driver_config%cloud_separation_scale_toa > 0.0_jprb) then 335 335 ! (2) Cloud separation scale provided in namelist 336 336 … … 386 386 allocate(cloud%inv_inhom_effective_size(ncol,nlev)) 387 387 where (cloud%fraction > config%cloud_fraction_threshold & 388 & . and. cloud%fraction < 1.0_jprb - config%cloud_fraction_threshold)388 & .AND. cloud%fraction < 1.0_jprb - config%cloud_fraction_threshold) 389 389 ! Convert effective cloud separation to effective cloud 390 390 ! size, noting divisions rather than multiplications … … 442 442 ! In cases (3) and (4) above the effective size obtained from 443 443 ! the NetCDF may be scaled by a namelist variable 444 if (is_cloud_size_scalable . and. driver_config%effective_size_scaling > 0.0_jprb) then444 if (is_cloud_size_scalable .AND. driver_config%effective_size_scaling > 0.0_jprb) then 445 445 ! Scale cloud effective size 446 446 cloud%inv_cloud_effective_size = cloud%inv_cloud_effective_size & … … 477 477 allocate(single_level%skin_temperature(ncol)) 478 478 single_level%skin_temperature(1:ncol) = thermodynamics%temperature_hl(1:ncol,nlev+1) 479 if (driver_config%iverbose >= 1 . and. config%do_lw &480 & . and. driver_config%skin_temperature_override < 0.0_jprb) then479 if (driver_config%iverbose >= 1 .AND. config%do_lw & 480 & .AND. driver_config%skin_temperature_override < 0.0_jprb) then 481 481 write(nulout,'(a)') 'Warning: skin temperature set equal to lowest air temperature' 482 482 end if -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/driver/ifs_blocking.F90
r5159 r5185 73 73 lldebug=(driver_config%iverbose>4) ! debug 74 74 llactaero = .false. 75 if(yradiation%rad_config%n_aerosol_types > 0 . and.&76 & yradiation%rad_config%n_aerosol_types <= 21 . and. yradiation%yrerad%naermacc == 0) then75 if(yradiation%rad_config%n_aerosol_types > 0 .AND.& 76 & yradiation%rad_config%n_aerosol_types <= 21 .AND. yradiation%yrerad%naermacc == 0) then 77 77 llactaero = .true. 78 78 endif … … 121 121 ifs_config%ihti =indrad(inext,nlev+1,.true.) 122 122 ifs_config%iaero =indrad(inext,yradiation%rad_config%n_aerosol_types*nlev,& 123 & llactaero . and. yradiation%yrerad%naermacc==0)123 & llactaero .AND. yradiation%yrerad%naermacc==0) 124 124 125 125 iinend =inext-1 ! end of input variables -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/ifsaux/abor1.F90
r5159 r5185 23 23 ! FLUSH not understood by NAG compiler 24 24 !CALL FLUSH(NULOUT) 25 IF (NULOUT /= 0 . and. NULOUT /= 6) CLOSE(NULOUT)25 IF (NULOUT /= 0 .AND. NULOUT /= 6) CLOSE(NULOUT) 26 26 ENDIF 27 27 -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/radiation/radiation_aerosol_optics.F90
r5159 r5185 292 292 else 293 293 iwn = 1 294 DO while (wavenumber(iwn+1) < wavenumber_target . and. iwn < nwn-1)294 DO while (wavenumber(iwn+1) < wavenumber_target .AND. iwn < nwn-1) 295 295 iwn = iwn + 1 296 296 end do … … 756 756 iband = config%i_band_from_reordered_g_sw(jg) 757 757 local_od = od_sw(jg,jlev,jcol) + od_sw_aerosol(iband,jlev) 758 if (local_od > 0.0_jprb . and. od_sw_aerosol(iband,jlev) > 0.0_jprb) then758 if (local_od > 0.0_jprb .AND. od_sw_aerosol(iband,jlev) > 0.0_jprb) then 759 759 local_scat = ssa_sw(jg,jlev,jcol) * od_sw(jg,jlev,jcol) & 760 760 & + scat_sw_aerosol(iband,jlev) … … 785 785 iband = config%i_band_from_reordered_g_lw(jg) 786 786 local_od = od_lw(jg,jlev,jcol) + od_lw_aerosol(iband,jlev) 787 if (local_od > 0.0_jprb . and. od_lw_aerosol(iband,jlev) > 0.0_jprb) then787 if (local_od > 0.0_jprb .AND. od_lw_aerosol(iband,jlev) > 0.0_jprb) then 788 788 ! All scattering is due to aerosols, therefore the 789 789 ! asymmetry factor is equal to the value for aerosols -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/radiation/radiation_aerosol_optics_data.F90
r5159 r5185 378 378 end if 379 379 380 if (n_type_philic > 0 . and. nrh > 0) then380 if (n_type_philic > 0 .AND. nrh > 0) then 381 381 if (n_bands_sw > 0) then 382 382 allocate(this%mass_ext_sw_philic(n_bands_sw, nrh, n_type_philic)) -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/radiation/radiation_aerosol_optics_description.F90
r5159 r5185 168 168 ! Check if we have a match 169 169 if (to_string(this%code_philic(:,ja)) == code_str & 170 & . and. trim(to_string(this%optical_model_philic(:,ja))) &170 & .AND. trim(to_string(this%optical_model_philic(:,ja))) & 171 171 & == optical_model_str) then 172 172 this%is_preferred_philic(ja) = .true. … … 178 178 DO ja = 1,size(this%bin_phobic) 179 179 if (to_string(this%code_phobic(:,ja)) == code_str & 180 & . and. trim(to_string(this%optical_model_phobic(:,ja))) &180 & .AND. trim(to_string(this%optical_model_phobic(:,ja))) & 181 181 & == optical_model_str) then 182 182 this%is_preferred_phobic(ja) = .true. … … 259 259 if (to_string(this%code_philic(:,ja)) == code_str) then 260 260 ! Aerosol code matches 261 if (present(ibin) . and. this%bin_philic(ja) > 0) then261 if (present(ibin) .AND. this%bin_philic(ja) > 0) then 262 262 if (ibin > 0) then 263 263 if (ibin == this%bin_philic(ja)) then … … 291 291 current_score = current_score + 2 292 292 end if 293 if (current_score > 0 . and. this%is_preferred_philic(ja)) then293 if (current_score > 0 .AND. this%is_preferred_philic(ja)) then 294 294 current_score = current_score + 1 295 295 end if … … 299 299 score = current_score 300 300 is_ambiguous = .false. 301 else if (current_score > 0 . and. current_score == score) then301 else if (current_score > 0 .AND. current_score == score) then 302 302 is_ambiguous = .true. 303 303 end if … … 310 310 if (to_string(this%code_phobic(:,ja)) == code_str) then 311 311 ! Aerosol code matches 312 if (present(ibin) . and. this%bin_phobic(ja) > 0) then312 if (present(ibin) .AND. this%bin_phobic(ja) > 0) then 313 313 if (ibin > 0) then 314 314 if (ibin == this%bin_phobic(ja)) then … … 342 342 current_score = current_score + 2 343 343 end if 344 if (current_score > 0 . and. this%is_preferred_phobic(ja)) then344 if (current_score > 0 .AND. this%is_preferred_phobic(ja)) then 345 345 current_score = current_score + 1 346 346 end if … … 350 350 score = current_score 351 351 is_ambiguous = .false. 352 else if (current_score > 0 . and. current_score == score) then352 else if (current_score > 0 .AND. current_score == score) then 353 353 is_ambiguous = .true. 354 354 end if -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/radiation/radiation_check.F90
r5159 r5185 48 48 if (allocated(var)) then 49 49 50 if (present(i1) . and. present(i2)) then50 if (present(i1) .AND. present(i2)) then 51 51 varmin = minval(var(i1:i2)) 52 52 varmax = maxval(var(i1:i2)) … … 62 62 is_bad = .true. 63 63 if (do_fix) then 64 if (present(i1) . and. present(i2)) then64 if (present(i1) .AND. present(i2)) then 65 65 var(i1:i2) = max(boundmin, min(boundmax, var(i1:i2))) 66 66 else … … 105 105 if (allocated(var)) then 106 106 107 if (present(i1) . and. present(i2)) then107 if (present(i1) .AND. present(i2)) then 108 108 ii1 = i1 109 109 ii2 = i2 … … 112 112 ii2 = ubound(var,1) 113 113 end if 114 if (present(j1) . and. present(j2)) then114 if (present(j1) .AND. present(j2)) then 115 115 jj1 = j1 116 116 jj2 = j2 … … 168 168 if (allocated(var)) then 169 169 170 if (present(i1) . and. present(i2)) then170 if (present(i1) .AND. present(i2)) then 171 171 ii1 = i1 172 172 ii2 = i2 … … 175 175 ii2 = ubound(var,1) 176 176 end if 177 if (present(j1) . and. present(j2)) then177 if (present(j1) .AND. present(j2)) then 178 178 jj1 = j1 179 179 jj2 = j2 … … 182 182 jj2 = ubound(var,2) 183 183 end if 184 if (present(k1) . and. present(k2)) then184 if (present(k1) .AND. present(k2)) then 185 185 kk1 = k1 186 186 kk2 = k2 -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/radiation/radiation_cloud_generator.F90
r5159 r5185 213 213 trigger = rand_top(jg) * total_cloud_cover 214 214 jlev = ibegin 215 DO while (trigger > cum_cloud_cover(jlev) . and. jlev < iend)215 DO while (trigger > cum_cloud_cover(jlev) .AND. jlev < iend) 216 216 jlev = jlev + 1 217 217 end do … … 693 693 694 694 ! For each spectral interval, has the first cloud appeared at this level? 695 first_cloud(jg) = (trigger(jg) <= cum_cloud_cover(jlev) . and. .not. found_cloud(jg))695 first_cloud(jg) = (trigger(jg) <= cum_cloud_cover(jlev) .AND. .not. found_cloud(jg)) 696 696 697 697 ! ...if so, add to found_cloud … … 703 703 ! prev_cloud) 704 704 is_cloud(jg) = first_cloud(jg) & 705 & .or. found_cloud(jg) . and. merge(rand_cloud(jg,jlev)*frac(jlev-1) &705 & .or. found_cloud(jg) .AND. merge(rand_cloud(jg,jlev)*frac(jlev-1) & 706 706 & < frac(jlev)+frac(jlev-1)-pair_cloud_cover(jlev-1), & 707 707 & rand_cloud(jg,jlev)*(cum_cloud_cover(jlev-1) - frac(jlev-1)) & … … 716 716 rand_inhom(jg,jlev) = merge(merge(rand_inhom(jg,jlev-1), rand_inhom(jg,jlev), & 717 717 & rand_inhom2(jg,jlev) < overlap_param_inhom(jlev-1) & 718 & . and. prev_cloud(jg)), &718 & .AND. prev_cloud(jg)), & 719 719 & 0.0_jprb, is_cloud(jg)) 720 720 end do -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/radiation/radiation_cloud_optics.F90
r5159 r5185 137 137 end if 138 138 else if (config%i_ice_model == IIceModelBaran & 139 & . and. size(config%cloud_optics%ice_coeff_lw, 2) &139 & .AND. size(config%cloud_optics%ice_coeff_lw, 2) & 140 140 & /= NIceOpticsCoeffsBaran) then 141 141 write(nulerr,'(a,i0,a,i0,a,i0,a)') & … … 145 145 call radiation_abort() 146 146 else if (config%i_ice_model == IIceModelBaran2016 & 147 & . and. size(config%cloud_optics%ice_coeff_lw, 2) &147 & .AND. size(config%cloud_optics%ice_coeff_lw, 2) & 148 148 & /= NIceOpticsCoeffsBaran2016) then 149 149 write(nulerr,'(a,i0,a,i0,a,i0,a)') & -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/radiation/radiation_config.F90
r5159 r5185 852 852 use_updated_solar_spectrum = this%use_updated_solar_spectrum 853 853 854 if (present(file_name) . and. present(unit)) then854 if (present(file_name) .AND. present(unit)) then 855 855 write(nulerr,'(a)') '*** Error: cannot specify both file_name and unit in call to config_type%read' 856 856 call radiation_abort('Radiation configuration error') 857 else if (.not. present(file_name) . and. .not. present(unit)) then857 else if (.not. present(file_name) .AND. .not. present(unit)) then 858 858 write(nulerr,'(a)') '*** Error: neither file_name nor unit specified in call to config_type%read' 859 859 call radiation_abort('Radiation configuration error') … … 1065 1065 1066 1066 ! Will clouds be used at all? 1067 if ((this%do_sw . and. this%i_solver_sw /= ISolverCloudless) &1068 & .or. (this%do_lw . and. this%i_solver_lw /= ISolverCloudless)) then1067 if ((this%do_sw .AND. this%i_solver_sw /= ISolverCloudless) & 1068 & .or. (this%do_lw .AND. this%i_solver_lw /= ISolverCloudless)) then 1069 1069 this%do_clouds = .true. 1070 1070 else … … 1073 1073 1074 1074 if (this%use_general_cloud_optics .or. this%use_general_aerosol_optics) then 1075 if (this%do_sw . and. this%do_cloud_aerosol_per_sw_g_point &1076 & . and. this%i_gas_model_sw == IGasModelIFSRRTMG) then1075 if (this%do_sw .AND. this%do_cloud_aerosol_per_sw_g_point & 1076 & .AND. this%i_gas_model_sw == IGasModelIFSRRTMG) then 1077 1077 write(nulout,'(a)') 'Warning: RRTMG SW only supports cloud/aerosol/surface optical properties per band, not per g-point' 1078 1078 this%do_cloud_aerosol_per_sw_g_point = .false. 1079 1079 end if 1080 if (this%do_lw . and. this%do_cloud_aerosol_per_lw_g_point &1081 & . and. this%i_gas_model_lw == IGasModelIFSRRTMG) then1080 if (this%do_lw .AND. this%do_cloud_aerosol_per_lw_g_point & 1081 & .AND. this%i_gas_model_lw == IGasModelIFSRRTMG) then 1082 1082 write(nulout,'(a)') 'Warning: RRTMG LW only supports cloud/aerosol/surface optical properties per band, not per g-point' 1083 1083 this%do_cloud_aerosol_per_lw_g_point = .false. … … 1113 1113 1114 1114 ! Check consistency of models 1115 if (this%do_canopy_fluxes_sw . and. .not. this%do_surface_sw_spectral_flux) then1115 if (this%do_canopy_fluxes_sw .AND. .not. this%do_surface_sw_spectral_flux) then 1116 1116 if (this%iverbosesetup >= 1) then 1117 1117 write(nulout,'(a)') 'Warning: turning on do_surface_sw_spectral_flux as required by do_canopy_fluxes_sw' … … 1121 1121 1122 1122 ! Will clouds be used at all? 1123 if ((this%do_sw . and. this%i_solver_sw /= ISolverCloudless) &1124 & .or. (this%do_lw . and. this%i_solver_lw /= ISolverCloudless)) then1123 if ((this%do_sw .AND. this%i_solver_sw /= ISolverCloudless) & 1124 & .or. (this%do_lw .AND. this%i_solver_lw /= ISolverCloudless)) then 1125 1125 this%do_clouds = .true. 1126 1126 else … … 1133 1133 & .or. this%i_solver_sw == ISolverTripleclouds & 1134 1134 & .or. this%i_solver_lw == ISolverTripleclouds) & 1135 & . and. this%i_overlap_scheme /= IOverlapExponentialRandom) then1135 & .AND. this%i_overlap_scheme /= IOverlapExponentialRandom) then 1136 1136 write(nulerr,'(a)') '*** Error: SPARTACUS/Tripleclouds solvers can only do Exponential-Random overlap' 1137 1137 call radiation_abort('Radiation configuration error') 1138 1138 end if 1139 1139 1140 if (jprb < jprd . and. this%iverbosesetup >= 1 &1141 & . and. (this%i_solver_sw == ISolverSPARTACUS &1140 if (jprb < jprd .AND. this%iverbosesetup >= 1 & 1141 & .AND. (this%i_solver_sw == ISolverSPARTACUS & 1142 1142 & .or. this%i_solver_lw == ISolverSPARTACUS)) then 1143 1143 write(nulout,'(a)') 'Warning: the SPARTACUS solver may be unstable in single precision' … … 1297 1297 end if 1298 1298 1299 if (this%use_aerosols . and. this%n_aerosol_types == 0) then1299 if (this%use_aerosols .AND. this%n_aerosol_types == 0) then 1300 1300 if (this%iverbosesetup >= 2) then 1301 1301 write(nulout, '(a)') 'Aerosols on but n_aerosol_types=0: optical properties to be computed outside ecRad' … … 1324 1324 end if 1325 1325 1326 if (this%i_solver_sw == ISolverSPARTACUS . and. this%do_sw_delta_scaling_with_gases) then1326 if (this%i_solver_sw == ISolverSPARTACUS .AND. this%do_sw_delta_scaling_with_gases) then 1327 1327 write(nulerr,'(a)') '*** Error: SW delta-Eddington scaling with gases not possible with SPARTACUS solver' 1328 1328 call radiation_abort('Radiation configuration error') 1329 1329 end if 1330 1330 1331 if ((this%do_lw . and. this%do_sw) .and. &1331 if ((this%do_lw .AND. this%do_sw) .AND. & 1332 1332 & ( ( this%i_solver_sw == ISolverHomogeneous & 1333 & . and. this%i_solver_lw /= ISolverHomogeneous) &1333 & .AND. this%i_solver_lw /= ISolverHomogeneous) & 1334 1334 & .or. ( this%i_solver_sw /= ISolverHomogeneous & 1335 & . and. this%i_solver_lw == ISolverHomogeneous) &1335 & .AND. this%i_solver_lw == ISolverHomogeneous) & 1336 1336 & ) ) then 1337 1337 write(nulerr,'(a)') '*** Error: if one solver is "Homogeneous" then the other must be' … … 1341 1341 ! Set is_homogeneous if the active solvers are homogeneous, since 1342 1342 ! this affects how "in-cloud" water contents are computed 1343 if ( (this%do_sw . and. this%i_solver_sw == ISolverHomogeneous) &1344 & .or. (this%do_lw . and. this%i_solver_lw == ISolverHomogeneous)) then1343 if ( (this%do_sw .AND. this%i_solver_sw == ISolverHomogeneous) & 1344 & .or. (this%do_lw .AND. this%i_solver_lw == ISolverHomogeneous)) then 1345 1345 this%is_homogeneous = .true. 1346 1346 end if … … 1669 1669 & wavelength1, ' to ', wavelength2, ' m is outside shortwave band' 1670 1670 call radiation_abort('Radiation configuration error') 1671 else if (this%iverbosesetup >= 2 . and. present(weighting_name)) then1671 else if (this%iverbosesetup >= 2 .AND. present(weighting_name)) then 1672 1672 write(nulout,'(a,a,a,f6.0,a,f6.0,a)') 'Spectral weights for ', & 1673 1673 & weighting_name, ' (', wavenumber1, ' to ', & … … 1741 1741 mapping = mapping_local(2:ninterval+1,:) 1742 1742 1743 if (this%iverbosesetup >= 2 . and. present(weighting_name)) then1743 if (this%iverbosesetup >= 2 .AND. present(weighting_name)) then 1744 1744 write(nulout,'(a,a)') 'Spectral mapping generated for ', & 1745 1745 & weighting_name -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/radiation/radiation_ecckd.F90
r5159 r5185 376 376 DO jwav = 1,nwav-1 377 377 if (wavenumber(jwav) < wavenumber_grid(jwav_grid) & 378 & . and. wavenumber(jwav+1) >= wavenumber_grid(jwav_grid)) then378 & .AND. wavenumber(jwav+1) >= wavenumber_grid(jwav_grid)) then 379 379 ! Linear interpolation - this is not perfect 380 380 ssi_grid(jwav_grid) = (ssi(jwav)*(wavenumber(jwav+1)-wavenumber_grid(jwav_grid)) & … … 650 650 651 651 ! Rayleigh scattering 652 if (this%is_sw . and. present(rayleigh_od_fl)) then652 if (this%is_sw .AND. present(rayleigh_od_fl)) then 653 653 DO jlev = 1,nlev 654 654 rayleigh_od_fl(:,jlev,jcol) = global_multiplier & … … 875 875 876 876 ! Rayleigh scattering 877 if (this%is_sw . and. present(rayleigh_od_fl)) then877 if (this%is_sw .AND. present(rayleigh_od_fl)) then 878 878 DO jcol = istartcol,iendcol 879 879 DO jlev = 1,nlev -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/radiation/radiation_ecckd_interface.F90
r5159 r5185 39 39 if (lhook) call dr_hook('radiation_ecckd_interface:setup_gas_optics',0,hook_handle) 40 40 41 if (config%do_sw . and. config%i_gas_model_sw == IGasModelECCKD) then41 if (config%do_sw .AND. config%i_gas_model_sw == IGasModelECCKD) then 42 42 43 43 ! Read shortwave ecCKD gas optics NetCDF file … … 84 84 end if 85 85 86 if (config%do_lw . and. config%i_gas_model_lw == IGasModelECCKD) then86 if (config%do_lw .AND. config%i_gas_model_lw == IGasModelECCKD) then 87 87 88 88 ! Read longwave ecCKD gas optics NetCDF file … … 255 255 end if 256 256 257 if (config%do_sw . and. config%i_gas_model_sw == IGasModelECCKD) then257 if (config%do_sw .AND. config%i_gas_model_sw == IGasModelECCKD) then 258 258 259 259 if (is_volume_mixing_ratio) then … … 293 293 end if 294 294 295 if (config%do_lw . and. config%i_gas_model_lw == IGasModelECCKD) then295 if (config%do_lw .AND. config%i_gas_model_lw == IGasModelECCKD) then 296 296 297 297 if (is_volume_mixing_ratio) then -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/radiation/radiation_flux.F90
r5159 r5185 414 414 if (lhook) call dr_hook('radiation_flux:calc_surface_spectral',0,hook_handle) 415 415 416 if (config%do_sw . and. config%do_surface_sw_spectral_flux) then416 if (config%do_sw .AND. config%do_surface_sw_spectral_flux) then 417 417 418 418 if (use_indexed_sum_vec) then … … 473 473 474 474 ! Fluxes in bands required for canopy radiative transfer 475 if (config%do_sw . and. config%do_canopy_fluxes_sw) then475 if (config%do_sw .AND. config%do_canopy_fluxes_sw) then 476 476 if (config%use_canopy_full_spectrum_sw) then 477 477 this%sw_dn_diffuse_surf_canopy(:,istartcol:iendcol) = this%sw_dn_diffuse_surf_g(:,istartcol:iendcol) … … 525 525 end if ! do_canopy_fluxes_sw 526 526 527 if (config%do_lw . and. config%do_canopy_fluxes_lw) then527 if (config%do_lw .AND. config%do_canopy_fluxes_lw) then 528 528 if (config%use_canopy_full_spectrum_lw) then 529 529 this%lw_dn_surf_canopy(:,istartcol:iendcol) = this%lw_dn_surf_g(:,istartcol:iendcol) … … 592 592 if (lhook) call dr_hook('radiation_flux:calc_toa_spectral',0,hook_handle) 593 593 594 if (config%do_sw . and. config%do_toa_spectral_flux) then594 if (config%do_sw .AND. config%do_toa_spectral_flux) then 595 595 596 596 if (use_indexed_sum_vec) then … … 627 627 end if 628 628 629 if (config%do_lw . and. config%do_toa_spectral_flux) then629 if (config%do_lw .AND. config%do_toa_spectral_flux) then 630 630 631 631 if (use_indexed_sum_vec) then -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/radiation/radiation_gas.F90
r5159 r5185 380 380 if (this%is_present(igas)) then 381 381 if (iunits == IMassMixingRatio & 382 & . and. this%iunits(igas) == IVolumeMixingRatio) then382 & .AND. this%iunits(igas) == IVolumeMixingRatio) then 383 383 sf = sf * GasMolarMass(igas) / AirMolarMass 384 384 else if (iunits == IVolumeMixingRatio & 385 & . and. this%iunits(igas) == IMassMixingRatio) then385 & .AND. this%iunits(igas) == IMassMixingRatio) then 386 386 sf = sf * AirMolarMass / GasMolarMass(igas) 387 387 end if … … 417 417 scaling = this%scale_factor 418 418 DO jg = 1,NMaxGases 419 if (iunits == IMassMixingRatio . and. this%iunits(jg) == IVolumeMixingRatio) then419 if (iunits == IMassMixingRatio .AND. this%iunits(jg) == IVolumeMixingRatio) then 420 420 scaling(jg) = scaling(jg) * GasMolarMass(jg) / AirMolarMass 421 else if (iunits == IVolumeMixingRatio . and. this%iunits(jg) == IMassMixingRatio) then421 else if (iunits == IVolumeMixingRatio .AND. this%iunits(jg) == IMassMixingRatio) then 422 422 scaling(jg) = scaling(jg) * AirMolarMass / GasMolarMass(jg) 423 423 end if … … 544 544 else 545 545 if (iunits == IMassMixingRatio & 546 & . and. this%iunits(igas) == IVolumeMixingRatio) then546 & .AND. this%iunits(igas) == IVolumeMixingRatio) then 547 547 sf = sf * GasMolarMass(igas) / AirMolarMass 548 548 else if (iunits == IVolumeMixingRatio & 549 & . and. this%iunits(igas) == IMassMixingRatio) then549 & .AND. this%iunits(igas) == IMassMixingRatio) then 550 550 sf = sf * AirMolarMass / GasMolarMass(igas) 551 551 end if -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/radiation/radiation_homogeneous_lw.F90
r5159 r5185 221 221 & / od_total 222 222 end where 223 where (ssa_total > 0.0_jprb . and. od_total > 0.0_jprb)223 where (ssa_total > 0.0_jprb .AND. od_total > 0.0_jprb) 224 224 g_total = (g(:,jlev,jcol)*ssa(:,jlev,jcol)*od(:,jlev,jcol) & 225 225 & + g_cloud(config%i_band_from_reordered_g_lw,jlev,jcol) & … … 233 233 & * od_cloud_g / od_total 234 234 end where 235 where (ssa_total > 0.0_jprb . and. od_total > 0.0_jprb)235 where (ssa_total > 0.0_jprb .AND. od_total > 0.0_jprb) 236 236 g_total = g_cloud(config%i_band_from_reordered_g_lw,jlev,jcol) & 237 237 & * ssa_cloud(config%i_band_from_reordered_g_lw,jlev,jcol) & -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/radiation/radiation_homogeneous_sw.F90
r5159 r5185 244 244 & / od_total 245 245 end where 246 where (ssa_total > 0.0_jprb . and. od_total > 0.0_jprb)246 where (ssa_total > 0.0_jprb .AND. od_total > 0.0_jprb) 247 247 g_total = (g(:,jlev,jcol)*ssa(:,jlev,jcol)*od(:,jlev,jcol) & 248 248 & + g_cloud(config%i_band_from_reordered_g_sw,jlev,jcol) & -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/radiation/radiation_ifs_rrtm.F90
r5159 r5185 81 81 if (lhook) call dr_hook('radiation_ifs_rrtm:setup_gas_optics',0,hook_handle) 82 82 83 do_sw = (config%do_sw . and. config%i_gas_model_sw == IGasModelIFSRRTMG)84 do_lw = (config%do_lw . and. config%i_gas_model_lw == IGasModelIFSRRTMG)83 do_sw = (config%do_sw .AND. config%i_gas_model_sw == IGasModelIFSRRTMG) 84 do_lw = (config%do_lw .AND. config%i_gas_model_lw == IGasModelIFSRRTMG) 85 85 86 86 ! The IFS implementation of RRTMG uses many global variables. In … … 373 373 if (lhook) call dr_hook('radiation_ifs_rrtm:gas_optics',0,hook_handle) 374 374 375 do_sw = (config%do_sw . and. config%i_gas_model_sw == IGasModelIFSRRTMG)376 do_lw = (config%do_lw . and. config%i_gas_model_lw == IGasModelIFSRRTMG)375 do_sw = (config%do_sw .AND. config%i_gas_model_sw == IGasModelIFSRRTMG) 376 do_lw = (config%do_lw .AND. config%i_gas_model_lw == IGasModelIFSRRTMG) 377 377 378 378 ! Compute start and end levels for indexing the gas mixing ratio … … 670 670 DO jcol = istartcol,iendcol 671 671 temperature = thermodynamics%temperature_hl(jcol,jlev+ilevoffset) 672 if (temperature < 339.0_jprb . and. temperature >= 160.0_jprb) then672 if (temperature < 339.0_jprb .AND. temperature >= 160.0_jprb) then 673 673 ! Linear interpolation between -113 and 66 degC 674 674 ind(jcol) = int(temperature - 159.0_jprb) … … 796 796 DO jcol = istartcol,iendcol 797 797 Tsurf = temperature(jcol) 798 if (Tsurf < 339.0_jprb . and. Tsurf >= 160.0_jprb) then798 if (Tsurf < 339.0_jprb .AND. Tsurf >= 160.0_jprb) then 799 799 ! Linear interpolation between -113 and 66 degC 800 800 ind(jcol) = int(Tsurf - 159.0_jprb) -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/radiation/radiation_interface.F90
r5159 r5185 83 83 84 84 if (config%do_lw_aerosol_scattering & 85 & . and. .not. config%do_lw_cloud_scattering) then85 & .AND. .not. config%do_lw_cloud_scattering) then 86 86 write(nulerr, '(a)') '*** Error: longwave aerosol scattering requires longwave cloud scattering' 87 87 call radiation_abort('Radiation configuration error') … … 114 114 ! solver_lw as they will be needed. 115 115 if (config%do_lw_cloud_scattering & 116 & . and. config%i_solver_lw == ISolverMcICA) then116 & .AND. config%i_solver_lw == ISolverMcICA) then 117 117 config%n_g_lw_if_scattering = config%n_g_lw 118 118 end if … … 404 404 ! a NetCDF file 405 405 if (config%do_save_radiative_properties) then 406 if (istartcol == 1 . and. iendcol == ncol) then406 if (istartcol == 1 .AND. iendcol == ncol) then 407 407 rad_prop_file_name = rad_prop_base_file_name // ".nc" 408 408 else -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/radiation/radiation_save.F90
r5159 r5185 87 87 88 88 if (config%i_gas_model_lw == IGasModelMonochromatic & 89 . and. config%mono_lw_wavelength > 0.0_jprb) then89 .AND. config%mono_lw_wavelength > 0.0_jprb) then 90 90 lw_units_str = 'W m-3' 91 91 else … … 127 127 end if 128 128 129 if (config%do_lw . and. config%do_canopy_fluxes_lw) then129 if (config%do_lw .AND. config%do_canopy_fluxes_lw) then 130 130 call out_file%define_dimension("canopy_band_lw", & 131 131 & size(flux%lw_dn_surf_canopy, 1)) 132 132 end if 133 if (config%do_sw . and. config%do_canopy_fluxes_sw) then133 if (config%do_sw .AND. config%do_canopy_fluxes_sw) then 134 134 call out_file%define_dimension("canopy_band_sw", & 135 135 & size(flux%sw_dn_diffuse_surf_canopy, 1)) … … 328 328 end if 329 329 330 if (config%do_lw . and. config%do_clouds) then330 if (config%do_lw .AND. config%do_clouds) then 331 331 call out_file%define_variable("cloud_cover_lw", & 332 332 & dim1_name="column", units_str="1", & … … 334 334 & standard_name="cloud_area_fraction") 335 335 end if 336 if (config%do_sw . and. config%do_clouds) then336 if (config%do_sw .AND. config%do_clouds) then 337 337 call out_file%define_variable("cloud_cover_sw", & 338 338 & dim1_name="column", units_str="1", & … … 444 444 end if 445 445 446 if (config%do_lw . and. config%do_clouds) then446 if (config%do_lw .AND. config%do_clouds) then 447 447 call out_file%put("cloud_cover_lw", flux%cloud_cover_lw) 448 448 end if 449 if (config%do_sw . and. config%do_clouds) then449 if (config%do_sw .AND. config%do_clouds) then 450 450 call out_file%put("cloud_cover_sw", flux%cloud_cover_sw) 451 451 end if … … 516 516 517 517 if (config%i_gas_model_lw == IGasModelMonochromatic & 518 . and. config%mono_lw_wavelength > 0.0_jprb) then518 .AND. config%mono_lw_wavelength > 0.0_jprb) then 519 519 lw_units_str = 'W m-3' 520 520 else … … 543 543 call out_file%define_dimension("half_level", n_lev_plus1) 544 544 545 if (config%do_lw . and. config%do_canopy_fluxes_lw) then545 if (config%do_lw .AND. config%do_canopy_fluxes_lw) then 546 546 call out_file%define_dimension("canopy_band_lw", & 547 547 & size(flux%lw_dn_surf_canopy, 1)) 548 548 end if 549 if (config%do_sw . and. config%do_canopy_fluxes_sw) then549 if (config%do_sw .AND. config%do_canopy_fluxes_sw) then 550 550 call out_file%define_dimension("canopy_band_sw", & 551 551 & size(flux%sw_dn_diffuse_surf_canopy, 1)) … … 838 838 & units_str="Pa", long_name="Pressure on half-levels") 839 839 840 if (allocated(thermodynamics%h2o_sat_liq) . and. config%use_aerosols) then840 if (allocated(thermodynamics%h2o_sat_liq) .AND. config%use_aerosols) then 841 841 call out_file%define_variable("q_sat_liquid", & 842 842 & dim2_name="column", dim1_name="level", & … … 953 953 call out_file%put("pressure_hl", thermodynamics%pressure_hl(istartcol:iendcol,:)) 954 954 955 if (allocated(thermodynamics%h2o_sat_liq) . and. config%use_aerosols) then955 if (allocated(thermodynamics%h2o_sat_liq) .AND. config%use_aerosols) then 956 956 call out_file%put("q_sat_liquid", thermodynamics%h2o_sat_liq(istartcol:iendcol,:)) 957 957 end if … … 1074 1074 nlev = nlev - 1 1075 1075 1076 do_aerosol = config%use_aerosols . and. present(aerosol)1076 do_aerosol = config%use_aerosols .AND. present(aerosol) 1077 1077 1078 1078 ! Open the file … … 1169 1169 & units_str="1", long_name="Ozone mass mixing ratio") 1170 1170 DO jgas = 1,NMaxGases 1171 if (gas%is_present(jgas) . and. jgas /= IH2O .and. jgas /= IO3) then1171 if (gas%is_present(jgas) .AND. jgas /= IH2O .AND. jgas /= IO3) then 1172 1172 write(var_name,'(a,a)') trim(GasLowerCaseName(jgas)), '_vmr' 1173 1173 write(long_name,'(a,a)') trim(GasName(jgas)), ' volume mixing ratio' … … 1244 1244 end if 1245 1245 call out_file%put("lw_emissivity", single_level%lw_emissivity) 1246 if (config%do_clouds . and. allocated(single_level%iseed)) then1246 if (config%do_clouds .AND. allocated(single_level%iseed)) then 1247 1247 allocate(seed(ncol)) 1248 1248 seed = single_level%iseed … … 1260 1260 call out_file%put("o3_mmr", mixing_ratio) 1261 1261 DO jgas = 1,NMaxGases 1262 if (gas%is_present(jgas) . and. jgas /= IH2O .and. jgas /= IO3) then1262 if (gas%is_present(jgas) .AND. jgas /= IH2O .AND. jgas /= IO3) then 1263 1263 write(var_name,'(a,a)') trim(GasLowerCaseName(jgas)), '_vmr' 1264 1264 call gas%get(jgas, IVolumeMixingRatio, mixing_ratio) -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/radiation/radiation_single_level.F90
r5159 r5185 325 325 end if 326 326 327 if (config%do_lw . and. present(lw_albedo)) then327 if (config%do_lw .AND. present(lw_albedo)) then 328 328 if (config%use_canopy_full_spectrum_lw) then 329 329 if (config%n_g_lw /= size(this%lw_emissivity,2)) then -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/radiation/radiation_spartacus_lw.F90
r5159 r5185 421 421 ! region and the sky is overcast then 3D calculations must 422 422 ! be turned off as there will be only one region 423 if (config%do_3d_effects . and. &424 & allocated(cloud%inv_cloud_effective_size) . and. &425 & .not. (nreg == 2 . and. cloud%fraction(jcol,jlev) &423 if (config%do_3d_effects .AND. & 424 & allocated(cloud%inv_cloud_effective_size) .AND. & 425 & .not. (nreg == 2 .AND. cloud%fraction(jcol,jlev) & 426 426 & > 1.0_jprb-config%cloud_fraction_threshold)) then 427 427 if (cloud%inv_cloud_effective_size(jcol,jlev) & … … 586 586 ! 3D effects for any further g-points 587 587 if (ng3D == ng & 588 & . and. od_region(jg,1) > config%max_gas_od_3D) then588 & .AND. od_region(jg,1) > config%max_gas_od_3D) then 589 589 ng3D = jg-1 590 590 end if … … 637 637 ! of the cloud 638 638 if (config%do_lw_side_emissivity & 639 & . and. region_fracs(1,jlev,jcol) > 0.0_jprb .and. region_fracs(2,jlev,jcol) > 0.0_jprb &640 & . and. config%do_3d_effects &641 & . and. cloud%inv_cloud_effective_size(jcol,jlev) > 0.0_jprb) then639 & .AND. region_fracs(1,jlev,jcol) > 0.0_jprb .AND. region_fracs(2,jlev,jcol) > 0.0_jprb & 640 & .AND. config%do_3d_effects & 641 & .AND. cloud%inv_cloud_effective_size(jcol,jlev) > 0.0_jprb) then 642 642 aspect_ratio = 1.0_jprb / (min(cloud%inv_cloud_effective_size(jcol,jlev), & 643 643 & 1.0_jprb / config%min_cloud_effective_size) & … … 894 894 ! source below a layer interface to the equivalent values 895 895 ! just above 896 if (is_clear_sky_layer(jlev) . and. is_clear_sky_layer(jlev-1)) then896 if (is_clear_sky_layer(jlev) .AND. is_clear_sky_layer(jlev-1)) then 897 897 ! If both layers are cloud free, this is trivial... 898 898 total_albedo(:,:,:,jlev) = 0.0_jprb … … 1014 1014 ! Account for overlap rules in translating fluxes just above 1015 1015 ! a layer interface to the values just below 1016 if (is_clear_sky_layer(jlev) . and. is_clear_sky_layer(jlev+1)) then1016 if (is_clear_sky_layer(jlev) .AND. is_clear_sky_layer(jlev+1)) then 1017 1017 flux_dn_below = flux_dn_above 1018 1018 else -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/radiation/radiation_spartacus_sw.F90
r5159 r5185 493 493 end if 494 494 495 if (config%do_3d_effects . and. &496 & allocated(cloud%inv_cloud_effective_size) . and. &497 & .not. (nreg == 2 . and. cloud%fraction(jcol,jlev) &495 if (config%do_3d_effects .AND. & 496 & allocated(cloud%inv_cloud_effective_size) .AND. & 497 & .not. (nreg == 2 .AND. cloud%fraction(jcol,jlev) & 498 498 & > 1.0-config%cloud_fraction_threshold)) then 499 499 if (cloud%inv_cloud_effective_size(jcol,jlev) > 0.0_jprb) then … … 662 662 ! 3D effects for any further g-points 663 663 if (ng3D == ng & 664 & . and. od_region(jg,1) > config%max_gas_od_3D) then664 & .AND. od_region(jg,1) > config%max_gas_od_3D) then 665 665 ng3D = jg-1 666 666 end if … … 935 935 if ((config%i_3d_sw_entrapment == IEntrapmentExplicitNonFractal & 936 936 & .or. config%i_3d_sw_entrapment == IEntrapmentExplicit) & 937 & . and. jlev >= i_cloud_top) then937 & .AND. jlev >= i_cloud_top) then 938 938 #else 939 939 if (config%i_3d_sw_entrapment == IEntrapmentExplicitNonFractal & … … 969 969 ! Account for cloud overlap when converting albedo and source 970 970 ! below a layer interface to the equivalent values just above 971 if (is_clear_sky_layer(jlev) . and. is_clear_sky_layer(jlev-1)) then971 if (is_clear_sky_layer(jlev) .AND. is_clear_sky_layer(jlev-1)) then 972 972 ! If both layers are cloud free, this is trivial... 973 973 total_albedo(:,:,:,jlev) = 0.0_jprb … … 1217 1217 & / max(config%cloud_fraction_threshold, region_fracs(jreg,jlev,jcol)) 1218 1218 DO jreg4 = 1,nreg ! VIA first lower region (jreg2 is second lower region) 1219 if (.not. (jreg4 == jreg . and. jreg4 /= jreg2)) then1219 if (.not. (jreg4 == jreg .AND. jreg4 /= jreg2)) then 1220 1220 albedo_part(:,jreg3,jreg) = albedo_part(:,jreg3,jreg) + entrapment(:,jreg3,jreg) & 1221 1221 & * v_matrix(jreg4,jreg,jlev,jcol) * total_albedo_below(:,jreg2,jreg4) … … 1305 1305 & / max(config%cloud_fraction_threshold, region_fracs(jreg,jlev,jcol)) 1306 1306 DO jreg4 = 1,nreg 1307 if (.not. (jreg4 == jreg . and. jreg4 /= jreg2)) then1307 if (.not. (jreg4 == jreg .AND. jreg4 /= jreg2)) then 1308 1308 albedo_part(:,jreg3,jreg) = albedo_part(:,jreg3,jreg) + entrapment(:,jreg3,jreg) & 1309 1309 & * v_matrix(jreg4,jreg,jlev,jcol) * total_albedo_below_direct(:,jreg2,jreg4) … … 1329 1329 if ((config%i_3d_sw_entrapment == IEntrapmentExplicitNonFractal & 1330 1330 & .or. config%i_3d_sw_entrapment == IEntrapmentExplicit) & 1331 & . and. .not. (is_clear_sky_layer(jlev) .and. is_clear_sky_layer(jlev-1))) then1331 & .AND. .not. (is_clear_sky_layer(jlev) .AND. is_clear_sky_layer(jlev-1))) then 1332 1332 ! Horizontal migration distances are averaged when 1333 1333 ! applying overlap rules, so equation is … … 1525 1525 ! Account for overlap rules in translating fluxes just above 1526 1526 ! a layer interface to the values just below 1527 if (is_clear_sky_layer(jlev) . and. is_clear_sky_layer(jlev+1)) then1527 if (is_clear_sky_layer(jlev) .AND. is_clear_sky_layer(jlev+1)) then 1528 1528 ! Regions in current layer map directly on to regions in 1529 1529 ! layer below -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/radiation/radiation_spectral_definition.F90
r5159 r5185 202 202 find_wavenumber = 1 203 203 DO while (wavenumber > this%wavenumber2(find_wavenumber) & 204 & . and. find_wavenumber < this%nwav)204 & .AND. find_wavenumber < this%nwav) 205 205 find_wavenumber = find_wavenumber + 1 206 206 end do … … 290 290 ! will be applicable 291 291 if (wavenumber(jwav) >= this%wavenumber1_band(jband) & 292 & . and. wavenumber(jwav) <= this%wavenumber2_band(jband)) then292 & .AND. wavenumber(jwav) <= this%wavenumber2_band(jband)) then 293 293 if (jwav > 1) then 294 294 wavenum1 = max(this%wavenumber1_band(jband), & … … 432 432 & / (this%wavenumber2(isd1)-this%wavenumber1(isd1)) 433 433 else 434 if (isd2 >= 1 . and. isd2 <= this%nwav) then434 if (isd2 >= 1 .AND. isd2 <= this%nwav) then 435 435 ! Right part of triangle 436 436 weight(isd2) = weight(isd2) + 0.5_jprb * (wavenum2-this%wavenumber1(isd2))**2 & … … 696 696 wavenumber2_bound = 0.01_jprb / wavelength_bound(jint-1) 697 697 where (wavenumber_mid > wavenumber1_bound & 698 & . and. wavenumber_mid <= wavenumber2_bound)698 & .AND. wavenumber_mid <= wavenumber2_bound) 699 699 i_input = i_intervals(jint) 700 700 end where -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/radiation/radiation_tripleclouds_lw.F90
r5159 r5185 325 325 & / od_total 326 326 end where 327 where (ssa_total > 0.0_jprb . and. od_total > 0.0_jprb)327 where (ssa_total > 0.0_jprb .AND. od_total > 0.0_jprb) 328 328 g_total = (g(:,jlev,jcol)*ssa(:,jlev,jcol)*od(:,jlev,jcol) & 329 329 & + g_cloud(config%i_band_from_reordered_g_lw,jlev,jcol) & … … 337 337 & * od_cloud_new / od_total 338 338 end where 339 where (ssa_total > 0.0_jprb . and. od_total > 0.0_jprb)339 where (ssa_total > 0.0_jprb .AND. od_total > 0.0_jprb) 340 340 g_total = g_cloud(config%i_band_from_reordered_g_lw,jlev,jcol) & 341 341 & * ssa_cloud(config%i_band_from_reordered_g_lw,jlev,jcol) & … … 418 418 ! Account for cloud overlap when converting albedo below a 419 419 ! layer interface to the equivalent values just above 420 if (is_clear_sky_layer(jlev) . and. is_clear_sky_layer(jlev-1)) then420 if (is_clear_sky_layer(jlev) .AND. is_clear_sky_layer(jlev-1)) then 421 421 total_albedo(:,:,jlev) = total_albedo_below(:,:) 422 422 total_source(:,:,jlev) = total_source_below(:,:) … … 518 518 519 519 if (.not. (is_clear_sky_layer(jlev) & 520 & . and. is_clear_sky_layer(jlev+1))) then520 & .AND. is_clear_sky_layer(jlev+1))) then 521 521 ! Account for overlap rules in translating fluxes just above 522 522 ! a layer interface to the values just below -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/radiation/radiation_tripleclouds_lw.F90.or
r4946 r5185 340 340 & / od_total 341 341 end where 342 where (ssa_total > 0.0_jprb . and. od_total > 0.0_jprb)342 where (ssa_total > 0.0_jprb .AND. od_total > 0.0_jprb) 343 343 g_total = (g(:,jlev,jcol)*ssa(:,jlev,jcol)*od(:,jlev,jcol) & 344 344 & + g_cloud(config%i_band_from_reordered_g_lw,jlev,jcol) & … … 352 352 & * od_cloud_new / od_total 353 353 end where 354 where (ssa_total > 0.0_jprb . and. od_total > 0.0_jprb)354 where (ssa_total > 0.0_jprb .AND. od_total > 0.0_jprb) 355 355 g_total = g_cloud(config%i_band_from_reordered_g_lw,jlev,jcol) & 356 356 & * ssa_cloud(config%i_band_from_reordered_g_lw,jlev,jcol) & … … 433 433 ! Account for cloud overlap when converting albedo below a 434 434 ! layer interface to the equivalent values just above 435 if (is_clear_sky_layer(jlev) . and. is_clear_sky_layer(jlev-1)) then435 if (is_clear_sky_layer(jlev) .AND. is_clear_sky_layer(jlev-1)) then 436 436 total_albedo(:,:,jlev) = total_albedo_below(:,:) 437 437 total_source(:,:,jlev) = total_source_below(:,:) … … 550 550 551 551 if (.not. (is_clear_sky_layer(jlev) & 552 & . and. is_clear_sky_layer(jlev+1))) then552 & .AND. is_clear_sky_layer(jlev+1))) then 553 553 ! Account for overlap rules in translating fluxes just above 554 554 ! a layer interface to the values just below -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/radiation/radiation_tripleclouds_sw.F90
r5159 r5185 18 18 ! 2017-10-23 R. Hogan Renamed single-character variables 19 19 ! 2018-10-08 R. Hogan Call calc_region_properties 20 ! 2019-01-02 R. Hogan Fixed problem of do_save_spectral_flux . and. .not. do_sw_direct20 ! 2019-01-02 R. Hogan Fixed problem of do_save_spectral_flux .AND. .not. do_sw_direct 21 21 ! 2020-09-18 R. Hogan Replaced some array expressions with loops for speed 22 22 ! 2021-10-01 P. Ukkonen Performance optimizations: batched computations … … 392 392 ! Account for cloud overlap when converting albedo below a 393 393 ! layer interface to the equivalent values just above 394 if (is_clear_sky_layer(jlev) . and. is_clear_sky_layer(jlev-1)) then394 if (is_clear_sky_layer(jlev) .AND. is_clear_sky_layer(jlev-1)) then 395 395 total_albedo(:,:,jlev) = total_albedo_below(:,:) 396 396 total_albedo_direct(:,:,jlev) = total_albedo_below_direct(:,:) … … 539 539 540 540 if (.not. (is_clear_sky_layer(jlev) & 541 & . and. is_clear_sky_layer(jlev+1))) then541 & .AND. is_clear_sky_layer(jlev+1))) then 542 542 ! Account for overlap rules in translating fluxes just above 543 543 ! a layer interface to the values just below -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/utilities/easy_netcdf.F90
r5159 r5185 763 763 DO j = 1, ndims 764 764 n = n * ndimlens(j) 765 if (j > 1 . and. ndimlens(j) > 1) then765 if (j > 1 .AND. ndimlens(j) > 1) then 766 766 write(nulerr,'(a,a,a)') '*** Error reading NetCDF variable ', & 767 767 & var_name, & … … 821 821 DO j = 1, ndims 822 822 n = n * ndimlens(j) 823 if (j > 1 . and. ndimlens(j) > 1) then823 if (j > 1 .AND. ndimlens(j) > 1) then 824 824 write(nulerr,'(a,a,a)') '*** Error reading NetCDF variable ', & 825 825 & var_name, & … … 880 880 DO j = 1, ndims 881 881 n = n * ndimlens(j) 882 if (j > 1 . and. ndimlens(j) > 1) then882 if (j > 1 .AND. ndimlens(j) > 1) then 883 883 write(nulerr,'(a,a,a)') '*** Error reading NetCDF variable ', & 884 884 & var_name, & … … 940 940 DO j = 1, ndims-1 941 941 n = n * ndimlens(j) 942 if (j > 1 . and. ndimlens(j) > 1) then942 if (j > 1 .AND. ndimlens(j) > 1) then 943 943 write(nulerr,'(a,a,a)') '*** Error reading 1D slice from NetCDF variable ', & 944 944 & var_name, & … … 1023 1023 DO j = 1, ndims 1024 1024 ntotal = ntotal * ndimlens(j) 1025 if (j > 2 . and. ndimlens(j) > 1) then1025 if (j > 2 .AND. ndimlens(j) > 1) then 1026 1026 write(nulerr,'(a,a,a)') '*** Error reading NetCDF variable ', & 1027 1027 & var_name, & … … 1135 1135 DO j = 1, ndims 1136 1136 ntotal = ntotal * ndimlens(j) 1137 if (j > 2 . and. ndimlens(j) > 1) then1137 if (j > 2 .AND. ndimlens(j) > 1) then 1138 1138 write(nulerr,'(a,a,a)') '*** Error reading NetCDF variable ', & 1139 1139 & var_name, & … … 1254 1254 DO j = 1, ndims-1 1255 1255 ntotal = ntotal * ndimlens(j) 1256 if (j > 2 . and. ndimlens(j) > 1) then1256 if (j > 2 .AND. ndimlens(j) > 1) then 1257 1257 write(nulerr,'(a,a,a)') '*** Error reading 2D slice from NetCDF variable ', & 1258 1258 & var_name, & … … 1378 1378 DO j = 1, ndims 1379 1379 ntotal = ntotal * ndimlens(j) 1380 if (j > 3 . and. ndimlens(j) > 1) then1380 if (j > 3 .AND. ndimlens(j) > 1) then 1381 1381 write(nulerr,'(a,a,a)') '*** Error reading NetCDF variable ', & 1382 1382 & var_name, & … … 1514 1514 DO j = 1, ndims-1 1515 1515 ntotal = ntotal * ndimlens(j) 1516 if (j > 3 . and. ndimlens(j) > 1) then1516 if (j > 3 .AND. ndimlens(j) > 1) then 1517 1517 write(nulerr,'(a,a,a)') '*** Error reading 3D slice from NetCDF variable ', & 1518 1518 & var_name, & … … 1656 1656 DO j = 1, ndims 1657 1657 ntotal = ntotal * ndimlens(j) 1658 if (j > 4 . and. ndimlens(j) > 1) then1658 if (j > 4 .AND. ndimlens(j) > 1) then 1659 1659 write(nulerr,'(a,a,a)') '*** Error reading NetCDF variable ', & 1660 1660 & var_name, & … … 1987 1987 end if 1988 1988 1989 if (present(dim1_name) . and. ndims_input >= 1) then1989 if (present(dim1_name) .AND. ndims_input >= 1) then 1990 1990 ! Variable is at least one dimensional 1991 1991 ndims_local = 1 … … 1996 1996 call my_abort('Error writing NetCDF file') 1997 1997 end if 1998 if (present(dim2_name) . and. ndims_input >= 2) then1998 if (present(dim2_name) .AND. ndims_input >= 2) then 1999 1999 ! Variable is at least two dimensional 2000 2000 ndims_local = 2 … … 2005 2005 call my_abort('Error writing NetCDF file') 2006 2006 end if 2007 if (present(dim3_name) . and. ndims_input >= 3) then2007 if (present(dim3_name) .AND. ndims_input >= 3) then 2008 2008 ! Variable is at least three dimensional 2009 2009 ndims_local = 3 … … 2014 2014 call my_abort('Error writing NetCDF file') 2015 2015 end if 2016 if (present(dim4_name) . and. ndims_input >= 4) then2016 if (present(dim4_name) .AND. ndims_input >= 4) then 2017 2017 ! Variable is at least three dimensional 2018 2018 ndims_local = 4 … … 2472 2472 ! Check the total size of the variable to be stored (but receiving 2473 2473 ! ntotal is zero then there must be an unlimited dimension) 2474 if (ntotal /= size(var,kind=jpib) . and. ntotal /= 0) then2474 if (ntotal /= size(var,kind=jpib) .AND. ntotal /= 0) then 2475 2475 write(nulerr,'(a,i0,a,a,a,i0)') '*** Error: attempt to write matrix of total size ', & 2476 2476 & nvarlen, ' to ', var_name, ' which has total size ', ntotal … … 2551 2551 write(var_slice_name,'(a,a,i0,a)') var_name, '(:,:,', index3, ')' 2552 2552 end if 2553 if (ntotal /= size(var,kind=jpib) . and. ntotal /= 0) then2553 if (ntotal /= size(var,kind=jpib) .AND. ntotal /= 0) then 2554 2554 write(nulerr,'(a,i0,a,a,a,i0)') '*** Error: attempt to write matrix of total size ', & 2555 2555 & nvarlen, ' to ', trim(var_slice_name), ' which has total size ', ntotal -
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/utilities/print_matrix.F90
r5158 r5185 47 47 write(unit_local,'(f16.8,$)') mat(i,j) 48 48 end do 49 if (present(name) . and. i == size(mat,1)) then49 if (present(name) .AND. i == size(mat,1)) then 50 50 write(unit_local,'(a)') ']' 51 51 else -
LMDZ6/branches/Amaury_dev/libf/phylmd/infotrac_phy.F90
r5159 r5185 129 129 SUBROUTINE init_infotrac_phy 130 130 USE lmdz_ioipsl_getin_p, ONLY: getin_p 131 #ifdef REPROBUS 132 USE CHEM_REP, ONLY: Init_chem_rep_trac 133 #endif 134 USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA, CPPKEY_STRATAER 131 USE lmdz_reprobus_wrappers, ONLY: Init_chem_rep_trac 132 USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA, CPPKEY_STRATAER, CPPKEY_REPROBUS 135 133 USE lmdz_abort_physic, ONLY: abort_physic 136 134 USE lmdz_iniprint, ONLY: lunout, prt_level 137 135 138 139 USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm 136 USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm 140 137 IMPLICIT NONE 141 138 !============================================================================================================================== … … 224 221 END IF 225 222 CASE('repr') 226 #ifndef REPROBUS 227 CALL abort_physic(modname, 'You must add cpp key REPROBUS and compile with REPROBUS code', 1)228 #endif 223 IF (.NOT. CPPKEY_REPROBUS) THEN 224 CALL abort_physic(modname, 'You must add cpp key REPROBUS and compile with REPROBUS code', 1) 225 END IF 229 226 CASE('coag') 230 227 IF (.NOT. CPPKEY_STRATAER) THEN … … 309 306 310 307 !--- Transfert the number of tracers to Reprobus 311 #ifdef REPROBUS 312 CALL Init_chem_rep_trac(nbtr, nqo, tracers(:)%name)313 #endif 308 IF (CPPKEY_REPROBUS) THEN 309 CALL Init_chem_rep_trac(nbtr, nqo, tracers(:)%name) 310 END IF 314 311 315 312 !############################################################################################################################## -
LMDZ6/branches/Amaury_dev/libf/phylmd/phys_local_var_mod.F90
r5132 r5185 806 806 REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_sed_part 807 807 !$OMP THREADPRIVATE(budg_sed_part) 808 #ifdef REPROBUS809 REAL,SAVE,ALLOCATABLE :: d_q_emiss(:,:)810 !$OMP THREADPRIVATE(d_q_emiss)811 #endif812 808 813 809 CONTAINS -
LMDZ6/branches/Amaury_dev/libf/phylmd/physiq_mod.F90
r5173 r5185 115 115 USE lmdz_calcul_divers, ONLY: calcul_divers 116 116 117 USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_DUST, CPPKEY_COSP, CPPKEY_COSP2, CPPKEY_COSPV2, CPPKEY_STRATAER 117 USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_DUST, CPPKEY_COSP, CPPKEY_COSP2, CPPKEY_COSPV2, CPPKEY_STRATAER, & 118 CPPKEY_REPROBUS 118 119 USE phys_local_var_mod, ONLY: d_q_emiss 119 120 USE strataer_local_var_mod … … 124 125 125 126 126 #ifdef REPROBUS 127 USE chem_rep, ONLY: Init_chem_rep_xjour, d_q_rep, d_ql_rep, d_qi_rep, & 127 USE lmdz_reprobus_wrappers, ONLY: Init_chem_rep_xjour, d_q_rep, d_ql_rep, d_qi_rep, & 128 128 ptrop, ttrop, ztrop, gravit, itroprep, Z1, Z2, fac, B 129 129 USE strataer_local_var_mod 130 130 USE strataer_emiss_mod, ONLY: strataer_emiss_init 131 #endif132 131 133 132 #ifdef CPP_RRTM … … 1823 1822 1824 1823 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1825 #ifdef REPROBUS 1826 CALL strataer_init1827 CALL strataer_emiss_init1828 #endif 1824 IF (CPPKEY_REPROBUS) THEN 1825 CALL strataer_init 1826 CALL strataer_emiss_init 1827 END IF 1829 1828 1830 1829 IF (CPPKEY_STRATAER) THEN … … 2189 2188 2190 2189 IF (type_trac == 'repr') THEN 2191 #ifdef REPROBUS 2192 CALL chemini_rep( & 2193 presnivs, & 2194 pdtphys, & 2195 annee_ref, & 2196 day_ref, & 2197 day_ini, & 2198 start_time, & 2199 itau_phy, & 2200 io_lon, & 2201 io_lat) 2202 #endif 2190 IF (CPPKEY_REPROBUS) THEN 2191 CALL chemini_rep(presnivs, pdtphys, annee_ref, day_ref, day_ini, start_time, itau_phy, io_lon, io_lat) 2192 END IF 2203 2193 ENDIF 2204 2194 … … 2300 2290 ! Update time and other variables in Reprobus 2301 2291 IF (type_trac == 'repr') THEN 2302 #ifdef REPROBUS 2303 CALL Init_chem_rep_xjour(jD_cur-jD_ref+day_ref)2304 PRINT*,'xjour equivalent rjourvrai',jD_cur-jD_ref+day_ref2305 CALL Rtime(debut)2306 #endif 2292 IF (CPPKEY_REPROBUS) THEN 2293 CALL Init_chem_rep_xjour(jD_cur - jD_ref + day_ref) 2294 PRINT*, 'xjour equivalent rjourvrai', jD_cur - jD_ref + day_ref 2295 CALL Rtime(debut) 2296 END IF 2307 2297 ENDIF 2308 2298 … … 2551 2541 2552 2542 wo(:, :, 1) = ozonecm(latitude_deg, paprs, read_climoz, rjour = zzz) 2553 #ifdef REPROBUS 2554 ptrop =dyn_tropopause(t_seri, ztsol, paprs, pplay, rot)/100.2543 IF (CPPKEY_REPROBUS) THEN 2544 ptrop = dyn_tropopause(t_seri, ztsol, paprs, pplay, rot) / 100. 2555 2545 DO i = 1, klon 2556 Z1=t_seri(i,itroprep(i)+1)2557 Z2=t_seri(i,itroprep(i))2558 fac=(Z1-Z2)/alog(pplay(i,itroprep(i)+1)/pplay(i,itroprep(i)))2559 B=Z2-fac*alog(pplay(i,itroprep(i)))2560 ttrop(i)= fac*alog(ptrop(i))+B2561 2562 Z1= 1.e-3 * ( pphi(i,itroprep(i)+1)+pphis(i)) / gravit2563 Z2= 1.e-3 * ( pphi(i,itroprep(i)) +pphis(i)) / gravit2564 fac=(Z1-Z2)/alog(pplay(i,itroprep(i)+1)/pplay(i,itroprep(i)))2565 B=Z2-fac*alog(pplay(i,itroprep(i)))2566 ztrop(i)=fac*alog(ptrop(i))+B2546 Z1 = t_seri(i, itroprep(i) + 1) 2547 Z2 = t_seri(i, itroprep(i)) 2548 fac = (Z1 - Z2) / alog(pplay(i, itroprep(i) + 1) / pplay(i, itroprep(i))) 2549 B = Z2 - fac * alog(pplay(i, itroprep(i))) 2550 ttrop(i) = fac * alog(ptrop(i)) + B 2551 2552 Z1 = 1.e-3 * (pphi(i, itroprep(i) + 1) + pphis(i)) / gravit 2553 Z2 = 1.e-3 * (pphi(i, itroprep(i)) + pphis(i)) / gravit 2554 fac = (Z1 - Z2) / alog(pplay(i, itroprep(i) + 1) / pplay(i, itroprep(i))) 2555 B = Z2 - fac * alog(pplay(i, itroprep(i))) 2556 ztrop(i) = fac * alog(ptrop(i)) + B 2567 2557 ENDDO 2568 #endif 2558 END IF 2569 2559 ELSE 2570 2560 !--- ro3i = elapsed days number since current year 1st january, 0h … … 4113 4103 ENDIF !type_trac = inca or inco 4114 4104 IF (type_trac == 'repr') THEN 4115 #ifdef REPROBUS 4116 !CALL chemtime_rep(itap+itau_phy-1, date0, dtime, itap)4117 CALL chemtime_rep(itap+itau_phy-1, date0, phys_tstep, itap)4118 #endif 4105 IF (CPPKEY_REPROBUS) THEN 4106 !CALL chemtime_rep(itap+itau_phy-1, date0, dtime, itap) 4107 CALL chemtime_rep(itap + itau_phy - 1, date0, phys_tstep, itap) 4108 END IF 4119 4109 ENDIF 4120 4110 … … 5163 5153 !MM dans Reprobus 5164 5154 sh_in(:, :) = q_seri(:, :) 5165 #ifdef REPROBUS 5166 d_q_rep(:,:) = 0.5167 d_ql_rep(:,:) = 0.5168 d_qi_rep(:,:) = 0.5169 #endif 5155 IF (CPPKEY_REPROBUS) THEN 5156 d_q_rep(:, :) = 0. 5157 d_ql_rep(:, :) = 0. 5158 d_qi_rep(:, :) = 0. 5159 END IF 5170 5160 ELSE 5171 5161 sh_in(:, :) = qx(:, :, ivap) … … 5220 5210 d_tr_dyn, & !<<RomP 5221 5211 tr_seri, init_source) 5222 #ifdef REPROBUS 5223 5224 5225 PRINT*,'avt add phys rep',abortphy 5226 5227 CALL add_phys_tend & 5228 (du0,dv0,dt0,d_q_rep,d_ql_rep,d_qi_rep,dqbs0,paprs,& 5229 'rep',abortphy,flag_inhib_tend,itap,0) 5230 IF (abortphy==1) Print*,'ERROR ABORT REP' 5231 5232 PRINT*,'apr add phys rep',abortphy 5233 5234 #endif 5212 IF (CPPKEY_REPROBUS) THEN 5213 5214 PRINT*, 'avt add phys rep', abortphy 5215 5216 CALL add_phys_tend & 5217 (du0, dv0, dt0, d_q_rep, d_ql_rep, d_qi_rep, dqbs0, paprs, & 5218 'rep', abortphy, flag_inhib_tend, itap, 0) 5219 IF (abortphy==1) Print*, 'ERROR ABORT REP' 5220 5221 PRINT*, 'apr add phys rep', abortphy 5222 5223 END IF 5235 5224 ENDIF ! (iflag_phytrac=1) 5236 5225 … … 5399 5388 5400 5389 IF (type_trac == 'repr') THEN 5401 #ifdef REPROBUS 5390 IF (CPPKEY_REPROBUS) THEN 5402 5391 CALL coord_hyb_rep(paprs, pplay, aps, bps, ap, bp, cell_area) 5403 #endif 5392 END IF 5404 5393 ENDIF 5405 5394 -
LMDZ6/branches/Amaury_dev/libf/phylmd/radiation_AR4.f90
r5184 r5185 472 472 USE radiation_ar4_param, ONLY: rsun, rray 473 473 USE infotrac_phy, ONLY: type_trac 474 #ifdefREPROBUS475 USE chem_rep, ONLY: rsuntime, ok_suntime474 USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_REPROBUS 475 USE lmdz_reprobus_wrappers, ONLY: rsuntime, ok_suntime 476 476 USE lmdz_print_control, ONLY: lunout 477 #endif478 477 479 478 IMPLICIT NONE … … 564 563 ! Otherwise keep default values from radiation_AR4_param module. 565 564 IF (type_trac=='repr') THEN 566 #ifdef REPROBUS 567 IF (ok_suntime) THEN 568 rsun(1) = rsuntime(1) 569 rsun(2) = rsuntime(2) 565 IF (CPPKEY_REPROBUS) THEN 566 IF (ok_suntime) THEN 567 rsun(1) = rsuntime(1) 568 rsun(2) = rsuntime(2) 569 END IF 570 WRITE (lunout, *) 'RSUN(1): ', rsun(1) 570 571 END IF 571 WRITE (lunout, *) 'RSUN(1): ', rsun(1)572 #endif573 572 END IF 574 573 … … 687 686 USE radiation_ar4_param, ONLY: rsun, rray 688 687 USE infotrac_phy, ONLY: type_trac 689 #ifdef REPROBUS 690 USE chem_rep, ONLY: rsuntime, ok_suntime 691 #endif 688 USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_REPROBUS 689 USE lmdz_reprobus_wrappers, ONLY: rsuntime, ok_suntime 692 690 693 691 IMPLICIT NONE … … 811 809 ! Otherwise keep default values from radiation_AR4_param module. 812 810 IF (type_trac=='repr') THEN 813 #ifdef REPROBUS 814 IF (ok_suntime) THEN 815 rsun(1) = rsuntime(1) 816 rsun(2) = rsuntime(2) 811 IF (CPPKEY_REPROBUS) THEN 812 IF (ok_suntime) THEN 813 rsun(1) = rsuntime(1) 814 rsun(2) = rsuntime(2) 815 END IF 817 816 END IF 818 #endif819 817 END IF 820 818 … … 2257 2255 USE radiation_ar4_param, ONLY: tref, rt1, raer, at, bt, oct 2258 2256 USE infotrac_phy, ONLY: type_trac 2259 #ifdef REPROBUS 2260 USE chem_rep, ONLY: rch42d, rn2o2d, rcfc112d, rcfc122d, ok_rtime2d 2261 #endif 2257 USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_REPROBUS 2258 USE lmdz_reprobus_wrappers, ONLY: rch42d, rn2o2d, rcfc112d, rcfc122d, ok_rtime2d 2262 2259 ! IM ctes ds clesphys.h 2263 2260 ! REAL(KIND=8) RCO2 … … 2558 2555 2559 2556 IF (type_trac=='repr') THEN 2560 #ifdef REPROBUS 2561 IF (ok_rtime2d) THEN2562 pabcu(jl, 19, jc) = pabcu(jl, 19, jcp1) + &2563 zably(jl, 8, jc)*rch42d(jl, jc)/rco2*zphm6(jl)*zdiff2564 pabcu(jl, 20, jc) = pabcu(jl, 20, jcp1) + &2565 zably(jl, 9, jc)*rch42d(jl, jc)/rco2*zpsm6(jl)*zdiff2566 pabcu(jl, 21, jc) = pabcu(jl, 21, jcp1) + &2567 zably(jl, 8, jc)*rn2o2d(jl, jc)/rco2*zphn6(jl)*zdiff2568 pabcu(jl, 22, jc) = pabcu(jl, 22, jcp1) + &2569 zably(jl, 9, jc)*rn2o2d(jl, jc)/rco2*zpsn6(jl)*zdiff2570 2571 pabcu(jl, 23, jc) = pabcu(jl, 23, jcp1) + &2572 zably(jl, 8, jc)*rcfc112d(jl, jc)/rco2*zdiff2573 pabcu(jl, 24, jc) = pabcu(jl, 24, jcp1) + &2574 zably(jl, 8, jc)*rcfc122d(jl, jc)/rco2*zdiff2575 ELSE2557 IF (CPPKEY_REPROBUS) THEN 2558 IF (ok_rtime2d) THEN 2559 pabcu(jl, 19, jc) = pabcu(jl, 19, jcp1) + & 2560 zably(jl, 8, jc) * rch42d(jl, jc) / rco2 * zphm6(jl) * zdiff 2561 pabcu(jl, 20, jc) = pabcu(jl, 20, jcp1) + & 2562 zably(jl, 9, jc) * rch42d(jl, jc) / rco2 * zpsm6(jl) * zdiff 2563 pabcu(jl, 21, jc) = pabcu(jl, 21, jcp1) + & 2564 zably(jl, 8, jc) * rn2o2d(jl, jc) / rco2 * zphn6(jl) * zdiff 2565 pabcu(jl, 22, jc) = pabcu(jl, 22, jcp1) + & 2566 zably(jl, 9, jc) * rn2o2d(jl, jc) / rco2 * zpsn6(jl) * zdiff 2567 2568 pabcu(jl, 23, jc) = pabcu(jl, 23, jcp1) + & 2569 zably(jl, 8, jc) * rcfc112d(jl, jc) / rco2 * zdiff 2570 pabcu(jl, 24, jc) = pabcu(jl, 24, jcp1) + & 2571 zably(jl, 8, jc) * rcfc122d(jl, jc) / rco2 * zdiff 2572 ELSE 2576 2573 ! Same calculation as for type_trac /= repr 2577 pabcu(jl, 19, jc) = pabcu(jl, 19, jcp1) + & 2578 zably(jl, 8, jc)*rch4/rco2*zphm6(jl)*zdiff 2579 pabcu(jl, 20, jc) = pabcu(jl, 20, jcp1) + & 2580 zably(jl, 9, jc)*rch4/rco2*zpsm6(jl)*zdiff 2581 pabcu(jl, 21, jc) = pabcu(jl, 21, jcp1) + & 2582 zably(jl, 8, jc)*rn2o/rco2*zphn6(jl)*zdiff 2583 pabcu(jl, 22, jc) = pabcu(jl, 22, jcp1) + & 2584 zably(jl, 9, jc)*rn2o/rco2*zpsn6(jl)*zdiff 2585 2586 pabcu(jl, 23, jc) = pabcu(jl, 23, jcp1) + & 2587 zably(jl, 8, jc)*rcfc11/rco2*zdiff 2588 pabcu(jl, 24, jc) = pabcu(jl, 24, jcp1) + & 2589 zably(jl, 8, jc)*rcfc12/rco2*zdiff 2574 pabcu(jl, 19, jc) = pabcu(jl, 19, jcp1) + & 2575 zably(jl, 8, jc) * rch4 / rco2 * zphm6(jl) * zdiff 2576 pabcu(jl, 20, jc) = pabcu(jl, 20, jcp1) + & 2577 zably(jl, 9, jc) * rch4 / rco2 * zpsm6(jl) * zdiff 2578 pabcu(jl, 21, jc) = pabcu(jl, 21, jcp1) + & 2579 zably(jl, 8, jc) * rn2o / rco2 * zphn6(jl) * zdiff 2580 pabcu(jl, 22, jc) = pabcu(jl, 22, jcp1) + & 2581 zably(jl, 9, jc) * rn2o / rco2 * zpsn6(jl) * zdiff 2582 2583 pabcu(jl, 23, jc) = pabcu(jl, 23, jcp1) + & 2584 zably(jl, 8, jc) * rcfc11 / rco2 * zdiff 2585 pabcu(jl, 24, jc) = pabcu(jl, 24, jcp1) + & 2586 zably(jl, 8, jc) * rcfc12 / rco2 * zdiff 2587 END IF 2590 2588 END IF 2591 #endif2592 2589 ELSE 2593 2590 pabcu(jl, 19, jc) = pabcu(jl, 19, jcp1) + & -
LMDZ6/branches/Amaury_dev/libf/phylmd/radlwsw_m.F90
r5160 r5185 3 3 module radlwsw_m 4 4 USE lmdz_abort_physic, ONLY: abort_physic 5 USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_REPROBUS 5 6 IMPLICIT NONE 6 7 … … 54 55 USE lmdz_yoethf 55 56 USE lmdz_phys_constants, ONLY: dobson_u 56 57 #ifdef REPROBUS 58 USE CHEM_REP, ONLY: solaireTIME, ok_SUNTIME, ndimozon 59 #endif 57 USE lmdz_reprobus_wrappers, ONLY: solaireTIME, ok_SUNTIME, ndimozon 60 58 61 59 #ifdef CPP_RRTM … … 560 558 561 559 IF (type_trac == 'repr') THEN 562 #ifdef REPROBUS 563 IF (iflag_rrtm==0) THEN564 IF (ok_SUNTIME) PSCT = solaireTIME /zdist/zdist565 PRINT*, 'Constante solaire: ',PSCT*zdist*zdist566 ENDIF567 #endif 560 IF (CPPKEY_REPROBUS) THEN 561 IF (iflag_rrtm==0) THEN 562 IF (ok_SUNTIME) PSCT = solaireTIME / zdist / zdist 563 PRINT*, 'Constante solaire: ', PSCT * zdist * zdist 564 ENDIF 565 END IF 568 566 ENDIF 569 567 … … 643 641 644 642 IF (type_trac == 'repr') THEN 645 #ifdef REPROBUS 643 IF (CPPKEY_REPROBUS) THEN 646 644 ndimozon = size(wo, 3) 647 CALL RAD_INTERACTIF(POZON, iof)648 #endif 645 CALL RAD_INTERACTIF(POZON, iof) 646 END IF 649 647 ENDIF 650 648 -
LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/dates.F90
r5159 r5185 136 136 !------------------------------------------------- 137 137 138 if(imi == 0 . and. imiv == 0) then138 if(imi == 0 .AND. imiv == 0) then 139 139 140 140 !------------------------------------------------- … … 885 885 ia100=100*(iaaaa/100) 886 886 ia4=4*(iaaaa/4) 887 if((iaaaa == ia400).or.((iaaaa == ia4). and.(iaaaa /= ia100)))then887 if((iaaaa == ia400).or.((iaaaa == ia4).AND.(iaaaa /= ia100)))then 888 888 ibissext=1 889 889 else 890 890 ibissext=0 891 891 endif 892 if ((ibissext == 1). and.(imm > 2)) then892 if ((ibissext == 1).AND.(imm > 2)) then 893 893 ijourp=1 894 894 else … … 924 924 ia100=100*(iaaaa/100) 925 925 ia4=4*(iaaaa/4) 926 if((iaaaa == ia400).or.((iaaaa == ia4). and.(iaaaa /= ia100)))then926 if((iaaaa == ia400).or.((iaaaa == ia4).AND.(iaaaa /= ia100)))then 927 927 ibissext=1 928 928 else 929 929 ibissext=0 930 930 endif 931 if ((ibissext == 1). and.(imm > 2)) then931 if ((ibissext == 1).AND.(imm > 2)) then 932 932 ijourp=1 933 933 else … … 1050 1050 ia100=100*(iaaaa/100) 1051 1051 ia4=4*(iaaaa/4) 1052 if((iaaaa == ia400).or.((iaaaa == ia4). and.(iaaaa /= ia100)))then1052 if((iaaaa == ia400).or.((iaaaa == ia4).AND.(iaaaa /= ia100)))then 1053 1053 ibissext=1 1054 1054 else -
LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/dump2ds.F
r5133 r5185 8 8 c NAN et INF ajoute aux plots Pat fin 2006 9 9 c ================================================================== 10 c Comme dump2d sauf que le signe est pr éservé, la valeur zero10 c Comme dump2d sauf que le signe est pr�serv�, la valeur zero 11 11 c identifiee par un blanc. 12 12 c detection des Infty (= ou -) et NaN (?) … … 79 79 kchar(i)=16 80 80 GOTO 10022 81 10021 IF(.NOT.((az.ne.0. and.icheck(1).eq.0.and.icheck(2).eq.2146435072))81 10021 IF(.NOT.((az.ne.0.AND.icheck(1).eq.0.AND.icheck(2).eq.2146435072)) 82 82 *)GOTO 10023 83 83 kchar(i)=31 84 84 zinf=.true. 85 85 GOTO 10022 86 10023 IF(.NOT.((az.ne.0. and.icheck(1).eq.0.and.icheck(2).eq.2146959360))86 10023 IF(.NOT.((az.ne.0.AND.icheck(1).eq.0.AND.icheck(2).eq.2146959360)) 87 87 *)GOTO 10024 88 88 kchar(i)=32 -
LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/eq_regions_mod.F90
r5159 r5185 170 170 integer(kind=jpim) :: num_c 171 171 logical enough 172 enough = (N > 2) . and. (a_ideal > 0)172 enough = (N > 2) .AND. (a_ideal > 0) 173 173 if( enough )then 174 174 num_c = max(1,nint((pi-2.*c_polar)/a_ideal)) -
LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/lwu.F90
r5160 r5185 1 2 1 ! $Id$ 3 2 … … 74 73 !USE YOERDI , ONLY : RCH4 ,RN2O ,RCFC11 ,RCFC12 75 74 USE YOERDU, ONLY: R10E, REPSCO, REPSCQ 76 #ifdef REPROBUS 77 USE chem_rep, ONLY: rch42d, rn2o2d, rcfc112d, rcfc122d, ok_rtime2d 78 USE infotrac_phy, ONLY : type_trac 79 #endif 75 USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_REPROBUS 76 USE lmdz_reprobus_wrappers, ONLY: rch42d, rn2o2d, rcfc112d, rcfc122d, ok_rtime2d 77 USE infotrac_phy, ONLY: type_trac 80 78 USE lmdz_clesphys 81 79 … … 319 317 PABCU(JL, 17, IC) = PABCU(JL, 17, ICP1) + ZUAER(JL, 4) * ZDUC(JL, IC) * ZDIFF 320 318 PABCU(JL, 18, IC) = PABCU(JL, 18, ICP1) + ZUAER(JL, 5) * ZDUC(JL, IC) * ZDIFF 321 #ifdef REPROBUS 322 IF (type_trac=='repr'.and. ok_rtime2d) THEN 323 !- CH4 324 PABCU(JL,19,IC)=PABCU(JL,19,ICP1)& 325 & + ZABLY(JL,2,IC)*RCH42D(JL, IC)/PCCO2*ZPHM6(JL)*ZDIFF 326 PABCU(JL,20,IC)=PABCU(JL,20,ICP1)& 327 & + ZABLY(JL,3,IC)*RCH42D(JL, IC)/PCCO2*ZPSM6(JL)*ZDIFF 328 !- N2O 329 PABCU(JL,21,IC)=PABCU(JL,21,ICP1)& 330 & + ZABLY(JL,2,IC)*RN2O2D(JL, IC)/PCCO2*ZPHN6(JL)*ZDIFF 331 PABCU(JL,22,IC)=PABCU(JL,22,ICP1)& 332 & + ZABLY(JL,3,IC)*RN2O2D(JL, IC)/PCCO2*ZPSN6(JL)*ZDIFF 333 !- CFC11 334 PABCU(JL,23,IC)=PABCU(JL,23,ICP1)& 335 & + ZABLY(JL,2,IC)*RCFC112D(JL, IC)/PCCO2 *ZDIFF 336 !- CFC12 337 PABCU(JL,24,IC)=PABCU(JL,24,ICP1)& 338 & + ZABLY(JL,2,IC)*RCFC122D(JL, IC)/PCCO2 *ZDIFF 339 340 ELSE 341 #endif 342 !- CH4 343 PABCU(JL, 19, IC) = PABCU(JL, 19, ICP1)& 344 & + ZABLY(JL, 2, IC) * RCH4 / PCCO2 * ZPHM6(JL) * ZDIFF 345 PABCU(JL, 20, IC) = PABCU(JL, 20, ICP1)& 346 & + ZABLY(JL, 3, IC) * RCH4 / PCCO2 * ZPSM6(JL) * ZDIFF 347 !- N2O 348 PABCU(JL, 21, IC) = PABCU(JL, 21, ICP1)& 349 & + ZABLY(JL, 2, IC) * RN2O / PCCO2 * ZPHN6(JL) * ZDIFF 350 PABCU(JL, 22, IC) = PABCU(JL, 22, ICP1)& 351 & + ZABLY(JL, 3, IC) * RN2O / PCCO2 * ZPSN6(JL) * ZDIFF 352 !- CFC11 353 PABCU(JL, 23, IC) = PABCU(JL, 23, ICP1)& 354 & + ZABLY(JL, 2, IC) * RCFC11 / PCCO2 * ZDIFF 355 !- CFC12 356 PABCU(JL, 24, IC) = PABCU(JL, 24, ICP1)& 357 & + ZABLY(JL, 2, IC) * RCFC12 / PCCO2 * ZDIFF 358 #ifdef REPROBUS 319 IF (CPPKEY_REPROBUS .AND. type_trac=='repr'.AND. ok_rtime2d) THEN 320 !- CH4 321 PABCU(JL, 19, IC) = PABCU(JL, 19, ICP1)& 322 & + ZABLY(JL, 2, IC) * RCH42D(JL, IC) / PCCO2 * ZPHM6(JL) * ZDIFF 323 PABCU(JL, 20, IC) = PABCU(JL, 20, ICP1)& 324 & + ZABLY(JL, 3, IC) * RCH42D(JL, IC) / PCCO2 * ZPSM6(JL) * ZDIFF 325 !- N2O 326 PABCU(JL, 21, IC) = PABCU(JL, 21, ICP1)& 327 & + ZABLY(JL, 2, IC) * RN2O2D(JL, IC) / PCCO2 * ZPHN6(JL) * ZDIFF 328 PABCU(JL, 22, IC) = PABCU(JL, 22, ICP1)& 329 & + ZABLY(JL, 3, IC) * RN2O2D(JL, IC) / PCCO2 * ZPSN6(JL) * ZDIFF 330 !- CFC11 331 PABCU(JL, 23, IC) = PABCU(JL, 23, ICP1)& 332 & + ZABLY(JL, 2, IC) * RCFC112D(JL, IC) / PCCO2 * ZDIFF 333 !- CFC12 334 PABCU(JL, 24, IC) = PABCU(JL, 24, ICP1)& 335 & + ZABLY(JL, 2, IC) * RCFC122D(JL, IC) / PCCO2 * ZDIFF 336 337 ELSE 338 !- CH4 339 PABCU(JL, 19, IC) = PABCU(JL, 19, ICP1)& 340 & + ZABLY(JL, 2, IC) * RCH4 / PCCO2 * ZPHM6(JL) * ZDIFF 341 PABCU(JL, 20, IC) = PABCU(JL, 20, ICP1)& 342 & + ZABLY(JL, 3, IC) * RCH4 / PCCO2 * ZPSM6(JL) * ZDIFF 343 !- N2O 344 PABCU(JL, 21, IC) = PABCU(JL, 21, ICP1)& 345 & + ZABLY(JL, 2, IC) * RN2O / PCCO2 * ZPHN6(JL) * ZDIFF 346 PABCU(JL, 22, IC) = PABCU(JL, 22, ICP1)& 347 & + ZABLY(JL, 3, IC) * RN2O / PCCO2 * ZPSN6(JL) * ZDIFF 348 !- CFC11 349 PABCU(JL, 23, IC) = PABCU(JL, 23, ICP1)& 350 & + ZABLY(JL, 2, IC) * RCFC11 / PCCO2 * ZDIFF 351 !- CFC12 352 PABCU(JL, 24, IC) = PABCU(JL, 24, ICP1)& 353 & + ZABLY(JL, 2, IC) * RCFC12 / PCCO2 * ZDIFF 359 354 END IF 360 #endif361 355 ENDDO 362 356 ENDDO -
LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/recmwf_aero.F90
r5159 r5185 592 592 593 593 !--Case 4 594 IF (ok_ade . and. ok_aie) THEN594 IF (ok_ade .AND. ok_aie) THEN 595 595 596 596 ! total aerosols for direct indirect effect … … 628 628 LWDN_AERO(:,:,4) = PFLUX(:,2,:) 629 629 630 ENDIF ! ok_ade . and. ok_aie630 ENDIF ! ok_ade .AND. ok_aie 631 631 632 632 ENDIF !--if flag_aerosol GT 0 OR flag_aerosol_strat … … 734 734 IF ( AEROSOLFEEDBACK_ACTIVE .AND. (flag_aerosol .GT. 0 .OR. flag_aerosol_strat) ) THEN 735 735 736 IF ( ok_ade . and. ok_aie ) THEN736 IF ( ok_ade .AND. ok_aie ) THEN 737 737 PFSUP(:,:) = ZFSUP_AERO(:,:,4) 738 738 PFSDN(:,:) = ZFSDN_AERO(:,:,4) … … 746 746 ENDIF 747 747 748 IF ( ok_ade . and. (.not. ok_aie) ) THEN748 IF ( ok_ade .AND. (.not. ok_aie) ) THEN 749 749 PFSUP(:,:) = ZFSUP_AERO(:,:,3) 750 750 PFSDN(:,:) = ZFSDN_AERO(:,:,3) … … 758 758 ENDIF 759 759 760 IF ( (.not. ok_ade) . and. ok_aie ) THEN760 IF ( (.not. ok_ade) .AND. ok_aie ) THEN 761 761 PFSUP(:,:) = ZFSUP_AERO(:,:,2) 762 762 PFSDN(:,:) = ZFSDN_AERO(:,:,2) … … 770 770 ENDiF 771 771 772 IF ((.not. ok_ade) . and. (.not. ok_aie)) THEN772 IF ((.not. ok_ade) .AND. (.not. ok_aie)) THEN 773 773 PFSUP(:,:) = ZFSUP_AERO(:,:,1) 774 774 PFSDN(:,:) = ZFSDN_AERO(:,:,1) -
LMDZ6/branches/Amaury_dev/libf/phylmd/rrtm/rrtm_rtrn1a_140gp.F90
r5160 r5185 383 383 ! & (1.0_JPRB - Z_CLDFRAC(I_LEV-1)) 384 384 ! ENDIF 385 if(istcld(i_lev).ne.1. and.i_lev.ne.1) then385 if(istcld(i_lev).ne.1.AND.i_lev.ne.1) then 386 386 z_faccmb1(i_lev+1) = max(0.,min(z_cldfrac(i_lev+1)-z_cldfrac(i_lev), & 387 387 z_cldfrac(i_lev-1)-z_cldfrac(i_lev))) … … 496 496 ! Z_FACCMB2D(I_LEV-1) = Z_FACCLD1D(I_LEV-1) * Z_FACCLR2D(I_LEV) *& 497 497 ! & (1.0_JPRB - Z_CLDFRAC(I_LEV+1)) 498 if (istcldd(i_lev).ne.1. and.i_lev.ne.1) then498 if (istcldd(i_lev).ne.1.AND.i_lev.ne.1) then 499 499 z_faccmb1d(i_lev-1) = max(0.,min(z_cldfrac(i_lev+1)-z_cldfrac(i_lev), & 500 500 z_cldfrac(i_lev-1)-z_cldfrac(i_lev))) -
LMDZ6/branches/Amaury_dev/libf/phylmd/tracreprobus_mod.f90
r5184 r5185 1 1 MODULE tracreprobus_mod 2 2 3 ! This module prepares and calls the Reprobus main SUBROUTINE3 ! This module prepares and calls the Reprobus main SUBROUTINE 4 4 5 5 CONTAINS 6 6 7 7 SUBROUTINE tracreprobus(pdtphys, gmtime, debutphy, julien, & 8 presnivs, xlat, xlon, pphis, pphi, &9 t_seri, pplay, paprs, sh, &10 tr_seri)8 presnivs, xlat, xlon, pphis, pphi, & 9 t_seri, pplay, paprs, sh, & 10 tr_seri) 11 11 12 12 USE dimphy 13 13 USE infotrac_phy, ONLY: nbtr 14 #ifdef REPROBUS 15 USE CHEM_REP, ONLY: pdt_rep, & ! pas de temps reprobus 16 daynum, iter, & ! jourjulien, iteration chimie 17 pdel,& 18 d_q_rep,d_ql_rep,d_qi_rep 19 #endif 14 USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_REPROBUS 15 USE lmdz_reprobus_wrappers, ONLY: pdt_rep, & ! pas de temps reprobus 16 daynum, iter, & ! jourjulien, iteration chimie 17 pdel, & 18 d_q_rep, d_ql_rep, d_qi_rep 20 19 IMPLICIT NONE 21 20 22 ! Input argument23 !---------------24 REAL, INTENT(IN):: pdtphys ! Pas d'integration pour la physique (seconde)25 REAL, INTENT(IN):: gmtime ! Heure courante26 LOGICAL, INTENT(IN) :: debutphy ! le flag de l'initialisation de la physique27 INTEGER, INTENT(IN) :: julien ! Jour julien21 ! Input argument 22 !--------------- 23 REAL, INTENT(IN) :: pdtphys ! Pas d'integration pour la physique (seconde) 24 REAL, INTENT(IN) :: gmtime ! Heure courante 25 LOGICAL, INTENT(IN) :: debutphy ! le flag de l'initialisation de la physique 26 INTEGER, INTENT(IN) :: julien ! Jour julien 28 27 29 REAL, DIMENSION(klev),INTENT(IN):: presnivs! pressions approximat. des milieux couches (en PA)30 REAL, DIMENSION(klon),INTENT(IN) :: xlat ! latitudes pour chaque point31 REAL, DIMENSION(klon),INTENT(IN) :: xlon ! longitudes pour chaque point32 REAL, DIMENSION(klon),INTENT(IN):: pphis ! geopotentiel du sol33 REAL, DIMENSION(klon,klev),INTENT(IN):: pphi ! geopotentiel de chaque couche28 REAL, DIMENSION(klev), INTENT(IN) :: presnivs! pressions approximat. des milieux couches (en PA) 29 REAL, DIMENSION(klon), INTENT(IN) :: xlat ! latitudes pour chaque point 30 REAL, DIMENSION(klon), INTENT(IN) :: xlon ! longitudes pour chaque point 31 REAL, DIMENSION(klon), INTENT(IN) :: pphis ! geopotentiel du sol 32 REAL, DIMENSION(klon, klev), INTENT(IN) :: pphi ! geopotentiel de chaque couche 34 33 35 REAL, DIMENSION(klon,klev),INTENT(IN):: t_seri ! Temperature36 REAL, DIMENSION(klon,klev),INTENT(IN):: pplay ! pression pour le mileu de chaque couche (en Pa)37 REAL, DIMENSION(klon,klev+1),INTENT(IN) :: paprs ! pression pour chaque inter-couche (en Pa)38 REAL, DIMENSION(klon,klev),INTENT(IN) :: sh ! humidite specifique34 REAL, DIMENSION(klon, klev), INTENT(IN) :: t_seri ! Temperature 35 REAL, DIMENSION(klon, klev), INTENT(IN) :: pplay ! pression pour le mileu de chaque couche (en Pa) 36 REAL, DIMENSION(klon, klev + 1), INTENT(IN) :: paprs ! pression pour chaque inter-couche (en Pa) 37 REAL, DIMENSION(klon, klev), INTENT(IN) :: sh ! humidite specifique 39 38 40 39 41 ! Output argument 42 !---------------- 43 REAL,DIMENSION(klon,klev,nbtr),INTENT(INOUT) :: tr_seri ! Concentration Traceur [U/KgA] 44 40 ! Output argument 41 !---------------- 42 REAL, DIMENSION(klon, klev, nbtr), INTENT(INOUT) :: tr_seri ! Concentration Traceur [U/KgA] 45 43 46 ! Local variables 47 !---------------- 44 45 ! Local variables 46 !---------------- 48 47 INTEGER :: it, k, niter 49 48 50 #ifdef REPROBUS 51 ! -- CHIMIE REPROBUS -- 52 ! pdt_rep=pdtphys/2. 53 niter=pdtphys/pdt_rep 54 WRITE(*,*)'nb d appel de REPROBUS',niter 55 56 DO k = 1, klev 57 pdel(:,k) = paprs(:,k) - paprs (:,k+1) 58 END DO 59 60 ! initialisation de ozone passif a ozone en debut d hiver HN et HS 61 IF (julien == 341 .OR. julien == 181) THEN 62 tr_seri(:,:,11)=tr_seri(:,:,8) 49 IF (CPPKEY_REPROBUS) THEN 50 ! -- CHIMIE REPROBUS -- 51 ! pdt_rep=pdtphys/2. 52 niter = pdtphys / pdt_rep 53 WRITE(*, *)'nb d appel de REPROBUS', niter 54 55 DO k = 1, klev 56 pdel(:, k) = paprs(:, k) - paprs (:, k + 1) 57 END DO 58 59 ! initialisation de ozone passif a ozone en debut d hiver HN et HS 60 IF (julien == 341 .OR. julien == 181) THEN 61 tr_seri(:, :, 11) = tr_seri(:, :, 8) 62 END IF 63 64 d_q_rep(:, :) = 0. 65 d_ql_rep(:, :) = 0. 66 d_qi_rep(:, :) = 0. 67 68 DO iter = 1, niter 69 daynum = FLOAT(julien) + gmtime + (iter - 1) * pdt_rep / 86400. 70 71 ! DO it=1, nbtr 72 ! WRITE(lunout,*)it,' ',minval(tr_seri(:,:,it)),maxval(tr_seri(:,:,it)) 73 ! seulement pour les especes chimiques (pas l'age de l'air) 74 ! verif valeurs extremes 75 ! correction: a 1.e-30 quand =0 ou negatif et 76 ! CALL abort si >ou= 1.e10 77 ! WRITE(*,*)it,'nqtot',nqtot,'nbtr',nbtr 78 ! IF (it < nqtot) THEN 79 ! WRITE(*,*)'iciav',it,nqtot 80 ! CALL minmaxqfi_chimie(it,tr_seri(1,1,it),0.,1.e10,'avant chimie ') 81 ! WRITE(*,*)iter,'avpres' 82 ! ENDIF 83 ! ENDDO 84 85 CALL chemmain_rlong_1401(& 86 tr_seri, & !argument phytrac (change de nom apres: vmr) 87 xlon, & !argument phytrac (change de nom apres: lon) 88 xlat, & !argument phytrac (change de nom apres: lat) 89 t_seri, & !argument phytrac (meme nom) 90 pplay, & !argument phytrac (meme nom) 91 paprs, & 92 pphi, & !argument phytrac (meme nom) 93 pphis, & !argument phytrac (meme nom) 94 presnivs, & !argument phytrac (meme nom) 95 sh, & !argument phytrac (meme nom) 96 debutphy) !argument phytrac (change de nom apres: debut) 97 ! pdel, pdt_rep, daynum : definit dans phytrac et utilise dans chemmain 98 ! et transporte par CHEM_REP 99 100 ! DO it=1, nbtr 101 ! WRITE(lunout,*)it,' ',minval(tr_seri(:,:,it)),maxval(tr_seri(:,:,it)) 102 ! seulement pour les especes chimiques (pas l'age de l'air) 103 ! verif valeurs extremes 104 ! correction: a 1.e-30 quand =0 ou negatif et 105 ! CALL abort si >ou= 1.e10 106 ! WRITE(*,*)it,'nqtot',nqtot,'nbtr',nbtr 107 ! IF (it < nqtot) THEN 108 ! WRITE(*,*)'iciap',it,nqtot 109 ! CALL minmaxqfi_chimie(it,tr_seri(1,1,it),0.,1.e10,'apres chemmain') 110 ! WRITE(*,*)iter,'appres' 111 ! ENDIF 112 ! ENDDO 113 114 END DO 63 115 END IF 64 65 d_q_rep(:,:) =0.66 d_ql_rep(:,:) =0.67 d_qi_rep(:,:) =0.68 69 DO iter = 1,niter70 daynum = FLOAT(julien) + gmtime + (iter-1)*pdt_rep/86400.71 72 ! DO it=1, nbtr73 ! WRITE(lunout,*)it,' ',minval(tr_seri(:,:,it)),maxval(tr_seri(:,:,it))74 ! seulement pour les especes chimiques (pas l'age de l'air)75 ! verif valeurs extremes76 ! correction: a 1.e-30 quand =0 ou negatif et77 ! CALL abort si >ou= 1.e1078 ! WRITE(*,*)it,'nqtot',nqtot,'nbtr',nbtr79 ! IF (it < nqtot) THEN80 ! WRITE(*,*)'iciav',it,nqtot81 !#ifdef REPROBUS82 ! CALL minmaxqfi_chimie(it,tr_seri(1,1,it),0.,1.e10,'avant chimie ')83 !#endif84 ! WRITE(*,*)iter,'avpres'85 ! ENDIF86 ! ENDDO87 88 #ifdef REPROBUS89 CALL chemmain_rlong_1401( &90 tr_seri, & !argument phytrac (change de nom apres: vmr)91 xlon, & !argument phytrac (change de nom apres: lon)92 xlat, & !argument phytrac (change de nom apres: lat)93 t_seri, & !argument phytrac (meme nom)94 pplay, & !argument phytrac (meme nom)95 paprs, &96 pphi, & !argument phytrac (meme nom)97 pphis, & !argument phytrac (meme nom)98 presnivs, & !argument phytrac (meme nom)99 sh, & !argument phytrac (meme nom)100 debutphy) !argument phytrac (change de nom apres: debut)101 ! pdel, pdt_rep, daynum : definit dans phytrac et utilise dans chemmain102 ! et transporte par CHEM_REP103 104 ! DO it=1, nbtr105 ! WRITE(lunout,*)it,' ',minval(tr_seri(:,:,it)),maxval(tr_seri(:,:,it))106 ! seulement pour les especes chimiques (pas l'age de l'air)107 ! verif valeurs extremes108 ! correction: a 1.e-30 quand =0 ou negatif et109 ! CALL abort si >ou= 1.e10110 ! WRITE(*,*)it,'nqtot',nqtot,'nbtr',nbtr111 ! IF (it < nqtot) THEN112 ! WRITE(*,*)'iciap',it,nqtot113 ! CALL minmaxqfi_chimie(it,tr_seri(1,1,it),0.,1.e10,'apres chemmain')114 ! WRITE(*,*)iter,'appres'115 ! ENDIF116 ! ENDDO117 118 #endif119 120 END DO121 #endif122 116 END SUBROUTINE tracreprobus 123 117 -
LMDZ6/branches/Amaury_dev/libf/phylmd/tropopause_m.f90
r5184 r5185 1 1 MODULE tropopause_m 2 2 3 IMPLICIT NONE 4 PRIVATE 5 PUBLIC :: dyn_tropopause 3 IMPLICIT NONE; PRIVATE 4 PUBLIC dyn_tropopause 6 5 7 6 CONTAINS … … 17 16 USE lmdz_geometry, ONLY: latitude_deg, longitude_deg 18 17 USE lmdz_vertical_layers, ONLY: aps, bps, preff 19 #ifdef REPROBUS 20 USE chem_rep, ONLY: itroprep 21 #endif 18 USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_REPROBUS 19 USE lmdz_reprobus_wrappers, ONLY: itroprep 22 20 USE lmdz_yomcst 23 21 … … 116 114 END DO; kp = kt 117 115 END IF 118 #ifdef REPROBUS 119 itroprep(i)=MAX(kt,kp)120 #endif 116 IF (CPPKEY_REPROBUS) THEN 117 itroprep(i) = MAX(kt, kp) 118 END IF 121 119 !--- LAST TROPOSPHERIC LAYER INDEX NEEDED 122 120 IF(PRESENT(itrop)) itrop(i) = MAX(kt, kp) -
LMDZ6/branches/Amaury_dev/libf/phylmdiso/physiq_mod.F90
r5173 r5185 116 116 USE lmdz_calcul_divers, ONLY: calcul_divers 117 117 118 USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_DUST, CPPKEY_STRATAER, CPPKEY_COSP, CPPKEY_COSP2, CPPKEY_COSPV2 118 USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_DUST, CPPKEY_STRATAER, CPPKEY_COSP, CPPKEY_COSP2, CPPKEY_COSPV2, & 119 CPPKEY_REPROBUS 119 120 120 121 !!!!!!!!!!!!!!!!!! "USE" section for CPP keys !!!!!!!!!!!!!!!!!!!!!!!! 121 122 122 123 123 #ifdef REPROBUS 124 USE chem_rep, ONLY: Init_chem_rep_xjour, d_q_rep, d_ql_rep, d_qi_rep, & 124 USE lmdz_reprobus_wrappers, ONLY: Init_chem_rep_xjour, d_q_rep, d_ql_rep, d_qi_rep, & 125 125 ptrop, ttrop, ztrop, gravit, itroprep, Z1, Z2, fac, B 126 126 USE strataer_local_var_mod 127 127 USE strataer_emiss_mod, ONLY: strataer_emiss_init 128 #endif129 128 130 129 #ifdef CPP_RRTM … … 1482 1481 CALL regr_horiz_time_climoz(read_climoz,ok_daily_climoz) 1483 1482 1484 #ifdef REPROBUS 1485 CALL strataer_init1486 CALL strataer_emiss_init1487 #endif 1483 IF (CPPKEY_REPROBUS) THEN 1484 CALL strataer_init 1485 CALL strataer_emiss_init 1486 END IF 1488 1487 1489 1488 IF (CPPKEY_STRATAER) THEN … … 2373 2372 2374 2373 IF (type_trac == 'repr') THEN 2375 #ifdef REPROBUS 2376 CALL chemini_rep(&2377 presnivs, &2378 pdtphys, &2379 annee_ref, &2380 day_ref,&2381 day_ini, &2382 start_time, &2383 itau_phy, &2384 io_lon, &2385 io_lat)2386 #endif 2374 IF (CPPKEY_REPROBUS) THEN 2375 CALL chemini_rep(& 2376 presnivs, & 2377 pdtphys, & 2378 annee_ref, & 2379 day_ref, & 2380 day_ini, & 2381 start_time, & 2382 itau_phy, & 2383 io_lon, & 2384 io_lat) 2385 END IF 2387 2386 ENDIF 2388 2387 … … 2490 2489 ! Update time and other variables in Reprobus 2491 2490 IF (type_trac == 'repr') THEN 2492 #ifdef REPROBUS 2493 CALL Init_chem_rep_xjour(jD_cur-jD_ref+day_ref)2494 PRINT*,'xjour equivalent rjourvrai',jD_cur-jD_ref+day_ref2495 CALL Rtime(debut)2496 #endif 2491 IF (CPPKEY_REPROBUS) THEN 2492 CALL Init_chem_rep_xjour(jD_cur - jD_ref + day_ref) 2493 PRINT*, 'xjour equivalent rjourvrai', jD_cur - jD_ref + day_ref 2494 CALL Rtime(debut) 2495 END IF 2497 2496 ENDIF 2498 2497 … … 2936 2935 2937 2936 wo(:,:,1)=ozonecm(latitude_deg, paprs,read_climoz,rjour=zzz) 2938 #ifdef REPROBUS 2939 ptrop=dyn_tropopause(t_seri, ztsol, paprs, pplay, rot)/100.2940 DO i = 1, klon2941 Z1=t_seri(i,itroprep(i)+1)2942 Z2=t_seri(i,itroprep(i))2943 fac=(Z1-Z2)/alog(pplay(i,itroprep(i)+1)/pplay(i,itroprep(i)))2944 B=Z2-fac*alog(pplay(i,itroprep(i)))2945 ttrop(i)= fac*alog(ptrop(i))+B2946 2947 Z1= 1.e-3 * ( pphi(i,itroprep(i)+1)+pphis(i)) / gravit2948 Z2= 1.e-3 * ( pphi(i,itroprep(i)) +pphis(i)) / gravit2949 fac=(Z1-Z2)/alog(pplay(i,itroprep(i)+1)/pplay(i,itroprep(i)))2950 B=Z2-fac*alog(pplay(i,itroprep(i)))2951 ztrop(i)=fac*alog(ptrop(i))+B2952 ENDDO2953 #endif 2937 IF (CPPKEY_REPROBUS) THEN 2938 ptrop = dyn_tropopause(t_seri, ztsol, paprs, pplay, rot) / 100. 2939 DO i = 1, klon 2940 Z1 = t_seri(i, itroprep(i) + 1) 2941 Z2 = t_seri(i, itroprep(i)) 2942 fac = (Z1 - Z2) / alog(pplay(i, itroprep(i) + 1) / pplay(i, itroprep(i))) 2943 B = Z2 - fac * alog(pplay(i, itroprep(i))) 2944 ttrop(i) = fac * alog(ptrop(i)) + B 2945 2946 Z1 = 1.e-3 * (pphi(i, itroprep(i) + 1) + pphis(i)) / gravit 2947 Z2 = 1.e-3 * (pphi(i, itroprep(i)) + pphis(i)) / gravit 2948 fac = (Z1 - Z2) / alog(pplay(i, itroprep(i) + 1) / pplay(i, itroprep(i))) 2949 B = Z2 - fac * alog(pplay(i, itroprep(i))) 2950 ztrop(i) = fac * alog(ptrop(i)) + B 2951 ENDDO 2952 END IF 2954 2953 ELSE 2955 2954 !--- ro3i = elapsed days number since current year 1st january, 0h … … 5602 5601 ENDIF !type_trac = inca or inco 5603 5602 IF (type_trac == 'repr') THEN 5604 #ifdef REPROBUS 5605 !CALL chemtime_rep(itap+itau_phy-1, date0, dtime, itap)5606 CALL chemtime_rep(itap+itau_phy-1, date0, phys_tstep, itap)5607 #endif 5603 IF (CPPKEY_REPROBUS) THEN 5604 !CALL chemtime_rep(itap+itau_phy-1, date0, dtime, itap) 5605 CALL chemtime_rep(itap + itau_phy - 1, date0, phys_tstep, itap) 5606 END IF 5608 5607 ENDIF 5609 5608 … … 6788 6787 !MM dans Reprobus 6789 6788 sh_in(:,:) = q_seri(:,:) 6790 #ifdef REPROBUS 6791 d_q_rep(:,:) = 0.6792 d_ql_rep(:,:) = 0.6793 d_qi_rep(:,:) = 0.6794 #endif 6789 IF (CPPKEY_REPROBUS) THEN 6790 d_q_rep(:, :) = 0. 6791 d_ql_rep(:, :) = 0. 6792 d_qi_rep(:, :) = 0. 6793 END IF 6795 6794 ELSE 6796 6795 sh_in(:,:) = qx(:,:,ivap) … … 6845 6844 d_tr_dyn, & !<<RomP 6846 6845 tr_seri, init_source) 6847 #ifdef REPROBUS 6848 6849 6850 PRINT*,'avt add phys rep',abortphy 6851 6852 CALL add_phys_tend & 6853 (du0,dv0,dt0,d_q_rep,d_ql_rep,d_qi_rep,dqbs0,paprs,& 6854 'rep',abortphy,flag_inhib_tend,itap,0) 6855 IF (abortphy==1) Print*,'ERROR ABORT REP' 6856 6857 PRINT*,'apr add phys rep',abortphy 6858 6859 #endif 6846 IF (CPPKEY_REPROBUS) THEN 6847 #ifdef ISO 6848 CALL abort_gcm("physiq_mod", "StratAer isn't ISO-compatible for now, 07/24",1) 6849 #else 6850 6851 PRINT*, 'avt add phys rep', abortphy 6852 6853 CALL add_phys_tend & 6854 (du0, dv0, dt0, d_q_rep, d_ql_rep, d_qi_rep, dqbs0, paprs, & 6855 'rep', abortphy, flag_inhib_tend, itap, 0) 6856 IF (abortphy==1) Print*, 'ERROR ABORT REP' 6857 6858 PRINT*, 'apr add phys rep', abortphy 6859 #endif 6860 END IF 6861 6860 6862 ENDIF ! (iflag_phytrac=1) 6861 6863 … … 7036 7038 7037 7039 IF (type_trac == 'repr') THEN 7038 #ifdef REPROBUS 7040 IF (CPPKEY_REPROBUS) THEN 7039 7041 CALL coord_hyb_rep(paprs, pplay, aps, bps, ap, bp, cell_area) 7040 #endif 7042 END IF 7041 7043 ENDIF 7042 7044 -
LMDZ6/branches/Amaury_dev/libf/phylmdiso/radiation_AR4.f90
r5184 r5185 1 link ../phylmd/radiation_AR4. F901 link ../phylmd/radiation_AR4.f90 -
LMDZ6/branches/Amaury_dev/libf/phylmdiso/tracreprobus_mod.f90
r5184 r5185 1 link ../phylmd/tracreprobus_mod. F901 link ../phylmd/tracreprobus_mod.f90 -
LMDZ6/branches/Amaury_dev/libf/phylmdiso/tropopause_m.f90
r5184 r5185 1 link ../phylmd/tropopause_m. F901 link ../phylmd/tropopause_m.f90
Note: See TracChangeset
for help on using the changeset viewer.