Changeset 5158 for LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/radiation/radiation_spectral_definition.F90
- Timestamp:
- Aug 2, 2024, 2:12:03 PM (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/Amaury_dev/libf/phylmd/ecrad/radiation/radiation_spectral_definition.F90
r4853 r5158 201 201 else 202 202 find_wavenumber = 1 203 dowhile (wavenumber > this%wavenumber2(find_wavenumber) &203 DO while (wavenumber > this%wavenumber2(find_wavenumber) & 204 204 & .and. find_wavenumber < this%nwav) 205 205 find_wavenumber = find_wavenumber + 1 … … 284 284 end if 285 285 286 dojband = 1,this%nband286 DO jband = 1,this%nband 287 287 weight = 0.0_jprb 288 dojwav = 1,nwav288 DO jwav = 1,nwav 289 289 ! Work out wavenumber range for which this cloud wavenumber 290 290 ! will be applicable … … 321 321 ! Find interpolating points 322 322 iwav = 2 323 dowhile (wavenumber(iwav) < this%wavenumber2_band(jband))323 DO while (wavenumber(iwav) < this%wavenumber2_band(jband)) 324 324 iwav = iwav+1 325 325 end do … … 358 358 mapping = 0.0_jprb 359 359 ! Loop over wavenumbers representing cloud 360 dojwav = 1,nwav360 DO jwav = 1,nwav 361 361 ! Clear the weights. The weight says for one wavenumber in the 362 362 ! cloud file, what is its fractional contribution to each of … … 400 400 & / (this%wavenumber2(isd1)-this%wavenumber1(isd1)) 401 401 if (isd1-isd0 > 1) then 402 doisd = isd0+1,isd1-1402 DO isd = isd0+1,isd1-1 403 403 ! Intermediate trapezia 404 404 weight(isd) = 0.5_jprb * (this%wavenumber1(isd)+this%wavenumber2(isd) & … … 447 447 & / (this%wavenumber2(isd1)-this%wavenumber1(isd1)) 448 448 if (isd2-isd1 > 1) then 449 doisd = isd1+1,isd2-1449 DO isd = isd1+1,isd2-1 450 450 ! Intermediate trapezia 451 451 weight(isd) = weight(isd) + 0.5_jprb * (2.0_jprb*wavenum2 & … … 468 468 weight = weight * planck_weight 469 469 470 dojg = 1,this%ng470 DO jg = 1,this%ng 471 471 mapping(jg, jwav) = sum(weight * this%gpoint_fraction(:,jg)) 472 472 end do … … 478 478 479 479 ! Normalize mapping matrix 480 dojg = 1,this%ng480 DO jg = 1,this%ng 481 481 mapping(jg,:) = mapping(jg,:) * (1.0_jprb/sum(mapping(jg,:))) 482 482 end do … … 589 589 ! Check wavelength is monotonically increasing 590 590 if (ninterval > 2) then 591 dojint = 2,ninterval-1591 DO jint = 2,ninterval-1 592 592 if (wavelength_bound(jint) <= wavelength_bound(jint-1)) then 593 593 write(nulerr, '(a)') '*** Error: wavelength bounds must be monotonically increasing' … … 609 609 end if 610 610 611 dojband = 1,this%nband612 dojint = 1,ninterval611 DO jband = 1,this%nband 612 DO jint = 1,ninterval 613 613 if (jint == 1) then 614 614 ! First input interval in wavelength space: lower … … 692 692 693 693 ! All bounded intervals 694 dojint = 2,ninterval-1694 DO jint = 2,ninterval-1 695 695 wavenumber1_bound = 0.01_jprb / wavelength_bound(jint) 696 696 wavenumber2_bound = 0.01_jprb / wavelength_bound(jint-1) … … 710 710 end if 711 711 712 dojg = 1,this%ng713 dojin = 1,ninput712 DO jg = 1,this%ng 713 DO jin = 1,ninput 714 714 mapping(jin,jg) = sum(this%gpoint_fraction(:,jg) * planck, & 715 715 & mask=(i_input==jin)) … … 723 723 724 724 ! Loop through all intervals 725 dojint = 1,ninterval725 DO jint = 1,ninterval 726 726 ! Loop through the wavenumbers for gpoint_fraction 727 dojwav = 1,this%nwav727 DO jwav = 1,this%nwav 728 728 if (jint == 1) then 729 729 ! First input interval in wavelength space: lower … … 758 758 end do 759 759 if (use_fluxes_local) then 760 dojg = 1,this%ng760 DO jg = 1,this%ng 761 761 mapping(:,jg) = mapping(:,jg) / sum(this%gpoint_fraction(:,jg) * planck) 762 762 end do … … 769 769 if (.not. use_fluxes_local) then 770 770 ! Normalize mapping matrix 771 dojg = 1,size(mapping,dim=2)771 DO jg = 1,size(mapping,dim=2) 772 772 mapping(:,jg) = mapping(:,jg) * (1.0_jprb/sum(mapping(:,jg))) 773 773 end do … … 828 828 is_band_unassigned = .true. 829 829 830 dojint = 1,ninterval830 DO jint = 1,ninterval 831 831 inext = minloc(wavelength1, dim=1, mask=is_band_unassigned) 832 832 if (jint > 1) then … … 873 873 write(nulout, '(a,i0,a,i0,a)') ' Mapping from ', nin, ' values to ', nout, ' bands (wavenumber ranges in cm-1)' 874 874 if (nout <= 40) then 875 dojout = 1,nout875 DO jout = 1,nout 876 876 write(nulout,'(i6,a,i6,a)',advance='no') nint(this%wavenumber1_band(jout)), ' to', & 877 877 & nint(this%wavenumber2_band(jout)), ':' 878 dojin = 1,nin878 DO jin = 1,nin 879 879 write(nulout,'(f5.2)',advance='no') mapping(jin,jout) 880 880 end do … … 882 882 end do 883 883 else 884 dojout = 1,30884 DO jout = 1,30 885 885 write(nulout,'(i6,a,i6,a)',advance='no') nint(this%wavenumber1_band(jout)), ' to', & 886 886 & nint(this%wavenumber2_band(jout)), ':' 887 dojin = 1,nin887 DO jin = 1,nin 888 888 write(nulout,'(f5.2)',advance='no') mapping(jin,jout) 889 889 end do … … 893 893 write(nulout,'(i6,a,i6,a)',advance='no') nint(this%wavenumber1_band(nout)), ' to', & 894 894 & nint(this%wavenumber2_band(nout)), ':' 895 dojin = 1,nin895 DO jin = 1,nin 896 896 write(nulout,'(f5.2)',advance='no') mapping(jin,nout) 897 897 end do … … 901 901 write(nulout, '(a,i0,a,i0,a)') ' Mapping from ', nin, ' values to ', nout, ' g-points' 902 902 if (nout <= 40) then 903 dojout = 1,nout903 DO jout = 1,nout 904 904 write(nulout,'(i3,a)',advance='no') jout, ':' 905 dojin = 1,nin905 DO jin = 1,nin 906 906 write(nulout,'(f5.2)',advance='no') mapping(jin,jout) 907 907 end do … … 909 909 end do 910 910 else 911 dojout = 1,30911 DO jout = 1,30 912 912 write(nulout,'(i3,a)',advance='no') jout, ':' 913 dojin = 1,nin913 DO jin = 1,nin 914 914 write(nulout,'(f5.2)',advance='no') mapping(jin,jout) 915 915 end do … … 918 918 write(nulout,'(a)') ' ...' 919 919 write(nulout,'(i3,a)',advance='no') nout, ':' 920 dojin = 1,nin920 DO jin = 1,nin 921 921 write(nulout,'(f5.2)',advance='no') mapping(jin,nout) 922 922 end do
Note: See TracChangeset
for help on using the changeset viewer.