Changeset 3504 for trunk/LMDZ.PLUTO/libf/phypluto/setspv.F90
- Timestamp:
- Nov 8, 2024, 10:57:14 AM (13 days ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.PLUTO/libf/phypluto/setspv.F90
r3184 r3504 2 2 3 3 !================================================================== 4 ! 4 ! 5 5 ! Purpose 6 6 ! ------- 7 ! Set up spectral intervals, stellar spectrum and Rayleigh 8 ! opacity in the shortwave. 9 ! 7 ! Set up spectral intervals, stellar spectrum and Rayleigh 8 ! opacity in the shortwave. 9 ! 10 10 ! Authors 11 ! ------- 11 ! ------- 12 12 ! Adapted from setspv in the NASA Ames radiative code by 13 13 ! Robin Wordsworth (2009). … … 16 16 ! --------- 17 17 ! callcorrk.F 18 ! 18 ! 19 19 ! Calls 20 20 ! ----- 21 21 ! ave_stelspec.F 22 ! 22 ! 23 23 !================================================================== 24 24 … … 28 28 use datafile_mod, only: datadir 29 29 use callkeys_mod, only: Fat1AU,rayleigh 30 use mod_phys_lmdz_para, only : is_master 30 31 31 32 implicit none … … 53 54 54 55 write(temp1,'(i2.2)') L_NSPECTV 55 file_id='/corrk_data/'//trim(adjustl(banddir))//'/narrowbands_VI.in' 56 file_id='/corrk_data/'//trim(adjustl(banddir))//'/narrowbands_VI.in' 56 57 file_path=TRIM(datadir)//TRIM(file_id) 57 58 … … 65 66 write(*,*)' datadir = /absolute/path/to/datagcm' 66 67 write(*,*)'Also check that the corrkdir you chose in callphys.def exists.' 67 call abort 68 call abort_physic("setspv", "File not found by setspi", 1) 68 69 endif 69 70 !$OMP MASTER 70 71 !$OMP MASTER 71 72 nb=0 72 73 ierr=0 73 ! check that the file contains the right number of bands 74 ! check that the file contains the right number of bands 74 75 open(131,file=file_path,form='formatted') 75 76 read(131,*,iostat=ierr) file_entries … … 80 81 close(131) 81 82 82 write(*,*) 'setspv: L_NSPECTV = ',L_NSPECTV, 'in the model ' 83 write(*,*) ' there are ',nb, 'entries in ',TRIM(file_path) 83 if (is_master) then 84 write(*,*) 'setspv: L_NSPECTV = ',L_NSPECTV, 'in the model ' 85 write(*,*) ' there are ',nb, 'entries in ',TRIM(file_path) 86 endif 84 87 if(nb.ne.L_NSPECTV) then 85 write(*,*) 'MISMATCH !! I stop here' 86 call abort 88 call abort_physic("setspv",'MISMATCH !! I stop here',1) 87 89 endif 88 90 89 91 ! load and display the data 90 92 open(111,file=file_path,form='formatted') 91 read(111,*) 93 read(111,*) 92 94 do M=1,L_NSPECTV-1 93 95 read(111,*) BWNV(M) … … 100 102 !$OMP BARRIER 101 103 102 print*,'setspv: VI band limits:' 103 do M=1,L_NSPECTV+1 104 print*,m,'-->',BWNV(M),' cm^-1' 105 end do 106 print*,' ' 104 if (is_master) then 105 print*,'setspv: VI band limits:' 106 do M=1,L_NSPECTV+1 107 print*,m,'-->',BWNV(M),' cm^-1' 108 end do 109 print*,' ' 110 endif 107 111 108 ! Set up mean wavenumbers and wavenumber deltas. Units of 112 ! Set up mean wavenumbers and wavenumber deltas. Units of 109 113 ! wavenumbers is cm^(-1); units of wavelengths is microns. 110 114 … … 121 125 ! Set up stellar spectrum 122 126 123 write(*,*)'setspv: Interpolating stellar spectrum from the hires data...'127 if (is_master) write(*,*)'setspv: Interpolating stellar spectrum from the hires data...' 124 128 call ave_stelspec(STELLAR) 125 129 126 ! Sum the stellar flux, and write out the result. 127 sum = 0.0 130 ! Sum the stellar flux, and write out the result. 131 sum = 0.0 128 132 do N=1,L_NSPECTV 129 133 STELLARF(N) = STELLAR(N) * Fat1AU 130 134 sum = sum+STELLARF(N) 131 135 end do 132 write(6,'("setspv: Stellar flux at 1 AU = ",f9.2," W m-2")') sum 133 print*,' ' 136 if (is_master)then 137 write(6,'("setspv: Stellar flux at 1 AU = ",f9.2," W m-2")') sum 138 print*,' ' 139 endif 134 140 135 141 … … 142 148 call calc_rayleigh 143 149 else 144 print*,'setspv: No Rayleigh scattering, check for NaN in output!'150 if (is_master) print*,'setspv: No Rayleigh scattering, check for NaN in output!' 145 151 do N=1,L_NSPECTV 146 152 TAURAY(N) = 1E-16
Note: See TracChangeset
for help on using the changeset viewer.