Changeset 5185 for LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad
- Timestamp:
- Sep 11, 2024, 4:27:07 PM (2 months ago)
- Location:
- LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad
- Files:
-
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.