Changeset 374
- Timestamp:
- Nov 10, 2011, 3:08:51 PM (13 years ago)
- Location:
- trunk/LMDZ.GENERIC
- Files:
-
- 13 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.GENERIC/README
r371 r374 541 541 'create_make_gcm'. 542 542 543 == 10/11/2011 == EM 544 - Upgrade: The location of the 'datagcm' directory can now be given in the 545 callphys.def file ( datadir = /absolute/path/to/datagcm ). Changed 546 "datafile.h" into a F90 module "datafile_mod.F90" and spread this change 547 to all routines that used to use "datafile.h". -
trunk/LMDZ.GENERIC/libf/dyn3d/newstart.F
r367 r374 1836 1836 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1837 1837 subroutine load_MONS_data(MONS_Hdn,MONS_d21) 1838 use datafile_mod, only: datadir 1838 1839 implicit none 1839 1840 ! routine to load Benedicte Diez MONS dataset, fill in date in southern … … 1841 1842 #include"dimensions.h" 1842 1843 #include"paramet.h" 1843 #include"datafile.h"1844 1844 #include"comgeom.h" 1845 1845 ! arguments: … … 1871 1871 1872 1872 ! Open MONS datafile: 1873 open(42,file=trim(data file)//"/"//trim(filename),1873 open(42,file=trim(datadir)//"/"//trim(filename), 1874 1874 & status="old",iostat=ierr) 1875 1875 if (ierr/=0) then 1876 1876 write(*,*) "Error in load_MONS_data:" 1877 1877 write(*,*) "Failed opening file ", 1878 & trim(datafile)//"/"//trim(filename) 1879 write(*,*)'1) You can change the path to the file in ' 1880 write(*,*)' file phymars/datafile.h' 1881 write(*,*)'2) If necessary ',trim(filename), 1878 & trim(datadir)//"/"//trim(filename) 1879 write(*,*)'Check that your path to datagcm:',trim(datadir) 1880 write(*,*)' is correct. You can change it in callphys.def with:' 1881 write(*,*)' datadir = /absolute/path/to/datagcm' 1882 write(*,*)'If necessary ',trim(filename), 1882 1883 & ' (and other datafiles)' 1883 1884 write(*,*)' can be obtained online at:' -
trunk/LMDZ.GENERIC/libf/phystd/ave_stelspec.F90
r253 r374 24 24 use radinc_h, only: L_NSPECTV 25 25 use radcommon_h, only: BWNV, DWNV, tstellar 26 use datafile_mod, only: datadir 26 27 27 28 implicit none 28 29 29 #include "datafile.h"30 30 #include "callkeys.h" 31 31 … … 47 47 real lam_temp 48 48 double precision stel_temp 49 50 integer :: ios ! file opening/reading status 49 51 50 52 STELLAR(:)=0.0 … … 52 54 ! load high resolution wavenumber data 53 55 file_id='/stellar_spectra/lam.txt' 54 file_path= datafile(1:LEN_TRIM(datafile))//file_id(1:LEN_TRIM(file_id))56 file_path=TRIM(datadir)//TRIM(file_id) 55 57 56 open(110,file=file_path,form='formatted') 57 do ifine=1,Nfine 58 read(110,*) lam(ifine) 59 enddo 60 close(110) 58 open(110,file=file_path,form='formatted',status='old',iostat=ios) 59 if (ios.ne.0) then ! file not found 60 write(*,*) 'Error from ave_stelspec' 61 write(*,*) 'Data file ',trim(file_id),' not found.' 62 write(*,*)'Check that your path to datagcm:',trim(datadir) 63 write(*,*)' is correct. You can change it in callphys.def with:' 64 write(*,*)' datadir = /absolute/path/to/datagcm' 65 write(*,*)' Also check that there is a ',trim(file_id),' there.' 66 call abort 67 else 68 do ifine=1,Nfine 69 read(110,*) lam(ifine) 70 enddo 71 close(110) 72 endif 61 73 62 74 dl=lam(2)-lam(1) … … 92 104 call abort 93 105 endif 94 file_path=datafile(1:LEN_TRIM(datafile))//file_id(1:LEN_TRIM(file_id)) 95 96 open(111,file=file_path,form='formatted') 97 do ifine=1,Nfine 98 read(111,*) stel_f(ifine) 99 enddo 100 close(111) 106 107 file_path=TRIM(datadir)//TRIM(file_id) 108 open(111,file=file_path,form='formatted',status='old',iostat=ios) 109 if (ios.ne.0) then ! file not found 110 write(*,*) 'Error from ave_stelspec' 111 write(*,*) 'Data file ',trim(file_id),' not found.' 112 write(*,*)'Check that your path to datagcm:',trim(datadir) 113 write(*,*)' is correct. You can change it in callphys.def with:' 114 write(*,*)' datadir = /absolute/path/to/datagcm' 115 write(*,*)' Also check that there is a ',trim(file_id),' there.' 116 call abort 117 else 118 do ifine=1,Nfine 119 read(111,*) stel_f(ifine) 120 enddo 121 close(111) 122 endif 101 123 endif 102 124 -
trunk/LMDZ.GENERIC/libf/phystd/callcorrk.F90
r366 r374 11 11 use radcommon_h 12 12 use watercommon_h 13 use datafile_mod, only: datadir 13 14 use ioipsl_getincom 14 15 … … 31 32 32 33 #include "dimphys.h" 33 #include "datafile.h"34 34 #include "comcstfi.h" 35 35 #include "callkeys.h" … … 233 233 endif 234 234 235 print*, " Correlated-k data base folder:",datafile235 print*, "callcorrk: Correlated-k data base folder:",trim(datadir) 236 236 call getin("corrkdir",corrkdir) 237 237 print*, "corrkdir = ",corrkdir -
trunk/LMDZ.GENERIC/libf/phystd/datafile_mod.F90
r371 r374 1 1 !----------------------------------------------------------------------- 2 ! INCLUDE datafile.h 2 module datafile_mod 3 ! Address of the directory containing tables of data needed by the UCM 4 implicit none 3 5 4 ! Address of the directory containing tables of data needed by the UCM 6 ! Default for Gnome Idataplex: 7 character(len=300) :: datadir='/san/home/rdword/gcm/datagcm' 8 ! Default for LMD machines: 9 ! character(len=300) :: datadir='/u/rwlmd/datagcm' 5 10 6 character (len=300) :: datafile 7 ! data datafile /'/home/rdword/gcm/datagcm_lite'/ ! laptop 8 data datafile /'/san/home/rdword/gcm/datagcm'/ ! gnome iDataPlex 9 ! data datafile /'/u/rwlmd/datagcm'/ ! planetary cluster 11 end module datafile_mod 10 12 !----------------------------------------------------------------------- -
trunk/LMDZ.GENERIC/libf/phystd/datareadnc.F
r135 r374 42 42 c======================================================================= 43 43 44 use datafile_mod, only: datadir 44 45 implicit none 45 46 … … 49 50 #include "comconst.h" 50 51 #include "netcdf.inc" 51 #include "datafile.h"52 52 53 53 c======================================================================= … … 112 112 113 113 write(*,*) 'Choice of surface data is:' 114 filestring='ls '// datafile(1:lnblnk(datafile))//'/*.nc'114 filestring='ls '//trim(datadir)//'/*.nc' 115 115 call system(filestring) 116 116 … … 120 120 read(*,fmt='(a20)') filename 121 121 122 ! ierr = NF_OPEN (datafile(1:lnblnk(datafile))//'/surface.nc', 123 ! & NF_NOWRITE,unit) 124 ierr = NF_OPEN (datafile(1:lnblnk(datafile))//'/'//filename, 122 ierr = NF_OPEN (trim(datadir)//'/'//trim(adjustl(filename)), 125 123 & NF_NOWRITE,unit) 126 124 IF (ierr.NE.NF_NOERR) THEN 127 write(*,*)'Error : cannot open file '// filename125 write(*,*)'Error : cannot open file '//trim(filename) 128 126 write(*,*)'(in phystd/datareadnc.F)' 129 write(*,*)'It should be in :',datafile(1:lnblnk(datafile)),'/' 130 write(*,*)'1) You can change this directory address in ' 131 write(*,*)' file phystd/datafile.h' 132 write(*,*)'2) If necessary surface.nc (and other datafiles)' 133 write(*,*)' can be obtained online on:' 127 write(*,*)'It should be in :',trim(datadir),'/' 128 write(*,*)'Check that your path to datagcm:',trim(datadir) 129 write(*,*)' is correct. You can change it in callphys.def with:' 130 write(*,*)' datadir = /absolute/path/to/datagcm' 131 write(*,*)'If necessary surface.nc (and other datafiles)' 132 write(*,*)' can be obtained online on:' 134 133 write(*,*)' http://www.lmd.jussieu.fr/~forget/datagcm/datafile' 135 134 CALL ABORT -
trunk/LMDZ.GENERIC/libf/phystd/inifis.F
r305 r374 5 5 6 6 use radinc_h, only : naerkind 7 7 use datafile_mod, only: datadir 8 8 9 9 !======================================================================= … … 42 42 ! declarations: 43 43 ! ------------- 44 use datafile_mod, only: datadir 44 45 ! to use 'getin' 45 46 USE ioipsl_getincom … … 121 122 PRINT*,'--------------------------------------------' 122 123 124 write(*,*) "Directory where external input files are:" 125 ! default 'datadir' is set in "datadir_mod" 126 call getin("datadir",datadir) ! default path 127 write(*,*) " datadir = ",trim(datadir) 128 123 129 write(*,*) "Run with or without tracer transport ?" 124 130 tracer=.false. ! default value -
trunk/LMDZ.GENERIC/libf/phystd/interpolateH2H2.F90
r305 r374 1 1 subroutine interpolateH2H2(wn,temp,pres,abcoef,firstcall) 2 implicit none3 2 4 3 !================================================================== … … 15 14 !================================================================== 16 15 17 #include "datafile.h" 16 use datafile_mod, only: datadir 17 implicit none 18 18 19 19 ! input … … 50 50 51 51 ! cold 52 dt_file= datafile(1:LEN_TRIM(datafile))//'/continuum_data/H2H2_CIA_LT.dat'52 dt_file=TRIM(datadir)//'/continuum_data/H2H2_CIA_LT.dat' 53 53 open(33,file=dt_file,form='formatted',status='old',iostat=ios) 54 54 if (ios.ne.0) then ! file not found 55 write(*,*) 'Error from interpolateH2H2.for' 56 write(*,*) 'Data file could not be found:' 57 write(*,*) dt_file 58 call abort 55 write(*,*) 'Error from interpolateH2H2' 56 write(*,*) 'Data file ',trim(dt_file),' not found.' 57 write(*,*)'Check that your path to datagcm:',trim(datadir) 58 write(*,*)' is correct. You can change it in callphys.def with:' 59 write(*,*)' datadir = /absolute/path/to/datagcm' 60 write(*,*)' Also check that there is a continuum_data/H2H2_CIA_LT.dat there.' 61 call abort 59 62 else 60 63 do k=1,nS … … 67 70 68 71 ! hot 69 dt_file= datafile(1:LEN_TRIM(datafile))//'/continuum_data/H2H2_CIA_HT.dat'72 dt_file=TRIM(datadir)//'/continuum_data/H2H2_CIA_HT.dat' 70 73 open(34,file=dt_file,form='formatted',status='old',iostat=ios) 71 74 if (ios.ne.0) then ! file not found 72 write(*,*) 'Error from interpolateH2H2.for' 73 write(*,*) 'Data file could not be found:' 74 write(*,*) dt_file 75 call abort 75 write(*,*) 'Error from interpolateH2H2' 76 write(*,*) 'Data file ',trim(dt_file),' not found.' 77 write(*,*)'Check that your path to datagcm:',trim(datadir) 78 write(*,*)' is correct. You can change it in callphys.def with:' 79 write(*,*)' datadir = /absolute/path/to/datagcm' 80 write(*,*)' Also check that there is a continuum_data/H2H2_CIA_HT.dat there.' 81 call abort 76 82 else 77 83 do k=1,nS … … 100 106 101 107 102 print*,' At wavenumber ',wn,' cm^-1'108 print*,'interpolateH2H2: At wavenumber ',wn,' cm^-1' 103 109 print*,' temperature ',temp,' K' 104 110 print*,' pressure ',pres,' Pa' … … 172 178 173 179 if ((y.lt.y_arr(1)).or.(y.gt.y_arr(nY))) then 174 write(*,*) 'Warning from bilinear .for:'180 write(*,*) 'Warning from bilinearH2H2:' 175 181 write(*,*) 'Outside continuum temperature range!' 176 182 if(y.lt.y_arr(1))then -
trunk/LMDZ.GENERIC/libf/phystd/interpolateH2Ocont.F90
r305 r374 1 1 subroutine interpolateH2Ocont(wn,temp,presS,presF,abcoef,firstcall) 2 implicit none3 2 4 3 !================================================================== … … 15 14 !================================================================== 16 15 17 #include "datafile.h" 16 use datafile_mod, only: datadir 17 implicit none 18 18 19 19 ! input … … 56 56 57 57 ! nu array 58 dt_file= datafile(1:LEN_TRIM(datafile))//'/continuum_data/H2O_CONT_NU.dat'58 dt_file=TRIM(datadir)//'/continuum_data/H2O_CONT_NU.dat' 59 59 open(33,file=dt_file,form='formatted',status='old',iostat=ios) 60 60 if (ios.ne.0) then ! file not found 61 write(*,*) 'Error from interpolateH2O_cont.for' 62 write(*,*) 'Data file could not be found:' 63 write(*,*) dt_file 64 call abort 61 write(*,*) 'Error from interpolateH2O_cont' 62 write(*,*) 'Data file ',trim(dt_file),' not found.' 63 write(*,*)'Check that your path to datagcm:',trim(datadir) 64 write(*,*)' is correct. You can change it in callphys.def with:' 65 write(*,*)' datadir = /absolute/path/to/datagcm' 66 write(*,*)' Also check that there is a continuum_data/H2O_CONT_NU.dat there.' 67 call abort 65 68 else 66 69 do k=1,nS … … 71 74 72 75 ! self broadening 73 dt_file= datafile(1:LEN_TRIM(datafile))//'/continuum_data/H2O_CONT_SELF.dat'76 dt_file=TRIM(datadir)//'/continuum_data/H2O_CONT_SELF.dat' 74 77 open(34,file=dt_file,form='formatted',status='old',iostat=ios) 75 78 if (ios.ne.0) then ! file not found 76 write(*,*) 'Error from interpolateH2O_cont.for' 77 write(*,*) 'Data file could not be found:' 78 write(*,*) dt_file 79 call abort 79 write(*,*) 'Error from interpolateH2O_cont' 80 write(*,*) 'Data file ',trim(dt_file),' not found.' 81 write(*,*)'Check that your path to datagcm:',trim(datadir) 82 write(*,*)' is correct. You can change it in callphys.def with:' 83 write(*,*)' datadir = /absolute/path/to/datagcm' 84 write(*,*)' Also check that there is a continuum_data/H2O_CONT_SELF.dat there.' 85 call abort 80 86 else 81 87 do k=1,nS … … 87 93 88 94 ! foreign (N2+O2+Ar) broadening 89 dt_file= datafile(1:LEN_TRIM(datafile))//'/continuum_data/H2O_CONT_FOREIGN.dat'95 dt_file=TRIM(datadir)//'/continuum_data/H2O_CONT_FOREIGN.dat' 90 96 open(35,file=dt_file,form='formatted',status='old',iostat=ios) 91 97 if (ios.ne.0) then ! file not found 92 write(*,*) 'Error from interpolateH2O_cont.for' 93 write(*,*) 'Data file could not be found:' 94 write(*,*) dt_file 95 call abort 98 write(*,*) 'Error from interpolateH2O_cont' 99 write(*,*) 'Data file ',trim(dt_file),' not found.' 100 write(*,*)'Check that your path to datagcm:',trim(datadir) 101 write(*,*)' is correct. You can change it in callphys.def with:' 102 write(*,*)' datadir = /absolute/path/to/datagcm' 103 write(*,*)' Also check that there is a continuum_data/H2O_CONT_FOREIGN.dat there.' 104 call abort 96 105 else 97 106 do k=1,nS … … 114 123 temp_arr(11) = 700. 115 124 116 print*,' At wavenumber ',wn,' cm^-1'125 print*,'interpolateH2Ocont: At wavenumber ',wn,' cm^-1' 117 126 print*,' temperature ',temp,' K' 118 127 print*,' H2O pressure ',presS,' Pa' … … 210 219 211 220 if ((y.lt.y_arr(1)).or.(y.gt.y_arr(nY))) then 212 write(*,*) 'Warning from bilinear .for:'221 write(*,*) 'Warning from bilinearH2Ocont:' 213 222 write(*,*) 'Outside continuum temperature range!' 214 223 if(y.lt.y_arr(1))then -
trunk/LMDZ.GENERIC/libf/phystd/setspi.F90
r253 r374 24 24 use radinc_h, only: L_NSPECTI,corrkdir,banddir,NTstar,NTstop 25 25 use radcommon_h, only: BWNI,BLAMI,WNOI,DWNI,WAVEI,planckir,sigma 26 use datafile_mod, only: datadir 26 27 27 28 implicit none … … 29 30 #include "callkeys.h" 30 31 #include "comcstfi.h" 31 #include "datafile.h"32 32 33 33 logical file_ok … … 74 74 !file_id='/corrk_data/' // corrkdir(1:LEN_TRIM(corrkdir)) // '/narrowbands_IR.in' 75 75 file_id='/corrk_data/'//trim(adjustl(banddir))//'/narrowbands_IR.in' 76 file_path= datafile(1:LEN_TRIM(datafile))//file_id(1:LEN_TRIM(file_id))76 file_path=TRIM(datadir)//TRIM(file_id) 77 77 78 78 ! check that the file exists 79 79 inquire(FILE=file_path,EXIST=file_ok) 80 80 if(.not.file_ok) then 81 write(*,*)'The file ', file_path(1:LEN_TRIM(file_path))81 write(*,*)'The file ',TRIM(file_path) 82 82 write(*,*)'was not found by setspi.F90, exiting.' 83 write(*,*)'Check that your path to datagcm:',trim(datadir) 84 write(*,*)' is correct. You can change it in callphys.def with:' 85 write(*,*)' datadir = /absolute/path/to/datagcm' 86 write(*,*)'Also check that the corrkdir you chose in callphys.def exists.' 83 87 call abort 84 88 endif … … 92 96 93 97 if(file_entries-1.ne.L_NSPECTI) then 94 write(*,*) ' L_NSPECTI = ',L_NSPECTI, 'in the model, but there are '98 write(*,*) 'setspi: L_NSPECTI = ',L_NSPECTI, 'in the model, but there are ' 95 99 write(*,*) file_entries-1,'entries in ', & 96 file_path(1:LEN_TRIM(file_path)),', exiting.'100 TRIM(file_path),', exiting.' 97 101 call abort 98 102 endif … … 110 114 111 115 print*,'' 112 print*,' IR band limits:'116 print*,'setspi: IR band limits:' 113 117 do M=1,L_NSPECTI+1 114 118 print*,m,'-->',BWNI(M),' cm^-1' … … 134 138 135 139 print*,'' 136 print*,' Current Planck integration range:'140 print*,'setspi: Current Planck integration range:' 137 141 print*,'T = ',dble(NTstar)/1.0D+1, ' to ',dble(NTstop)/1.0D+1,' K.' 138 142 … … 157 161 ! force planck=sigma*eps*T^4 for each temperature in array 158 162 if(forceEC)then 159 print*,' Force F=sigma*eps*T^4 for all values of T!'163 print*,'setspi: Force F=sigma*eps*T^4 for all values of T!' 160 164 do nt=NTstar,NTstop 161 165 plancksum=0.0 … … 182 186 plancksum=plancksum+planckir(NW,nt-NTstar+1)*DWNI(NW)*pi 183 187 end do 184 print*,' At lower limit:'188 print*,'setspi: At lower limit:' 185 189 print*,'in model sig*T^4 = ',plancksum,' W m^-2' 186 190 print*,'actual sig*T^4 = ',sigma*(dble(nt)/1.0D+1)**4,' W m^-2' … … 192 196 plancksum=plancksum+planckir(NW,nt-NTstar+1)*DWNI(NW)*pi 193 197 end do 194 print*,' At upper limit:'198 print*,'setspi: At upper limit:' 195 199 print*,'in model sig*T^4 = ',plancksum,' W m^-2' 196 200 print*,'actual sig*T^4 = ',sigma*(dble(nt)/1.0D+1)**4,' W m^-2' -
trunk/LMDZ.GENERIC/libf/phystd/setspv.F90
r253 r374 26 26 use radcommon_h, only: BWNV,BLAMV,WNOV,DWNV,WAVEV, & 27 27 STELLARF,TAURAY,gastype 28 use datafile_mod, only: datadir 28 29 29 30 implicit none … … 31 32 #include "comcstfi.h" 32 33 #include "callkeys.h" 33 #include "datafile.h"34 34 35 35 logical file_ok … … 52 52 write(temp1,'(i2.2)') L_NSPECTV 53 53 file_id='/corrk_data/'//trim(adjustl(banddir))//'/narrowbands_VI.in' 54 file_path= datafile(1:LEN_TRIM(datafile))//file_id(1:LEN_TRIM(file_id))54 file_path=TRIM(datadir)//TRIM(file_id) 55 55 56 56 ! check that the file exists 57 57 inquire(FILE=file_path,EXIST=file_ok) 58 58 if(.not.file_ok) then 59 write(*,*)'The file ', file_path(1:LEN_TRIM(file_path))59 write(*,*)'The file ',TRIM(file_path) 60 60 write(*,*)'was not found by setspv.F90, exiting.' 61 write(*,*)'Check that your path to datagcm:',trim(datadir) 62 write(*,*)' is correct. You can change it in callphys.def with:' 63 write(*,*)' datadir = /absolute/path/to/datagcm' 64 write(*,*)'Also check that the corrkdir you chose in callphys.def exists.' 61 65 call abort 62 66 endif … … 70 74 71 75 if(file_entries-1.ne.L_NSPECTV) then 72 write(*,*) ' L_NSPECTV = ',L_NSPECTV, 'in the model, but there are '76 write(*,*) 'setspv: L_NSPECTV = ',L_NSPECTV, 'in the model, but there are ' 73 77 write(*,*) file_entries-1,'entries in ', & 74 file_path(1:LEN_TRIM(file_path)),', exiting.'78 TRIM(file_path),', exiting.' 75 79 call abort 76 80 endif … … 88 92 89 93 90 print*,' VI band limits:'94 print*,'setspv: VI band limits:' 91 95 do M=1,L_NSPECTV+1 92 96 print*,m,'-->',BWNV(M),' cm^-1' … … 109 113 ! Set up stellar spectrum 110 114 111 write(*,*)' Interpolating stellar spectrum from the hires data...'115 write(*,*)'setspv: Interpolating stellar spectrum from the hires data...' 112 116 call ave_stelspec(STELLAR) 113 117 … … 118 122 sum = sum+STELLARF(N) 119 123 end do 120 write(6,'(" Stellar flux at 1 AU = ",f7.2," W m-2")') sum124 write(6,'("setspv: Stellar flux at 1 AU = ",f7.2," W m-2")') sum 121 125 print*,' ' 122 126 … … 130 134 call calc_rayleigh 131 135 else 132 print*,' No Rayleigh scattering, check for NaN in output!'136 print*,'setspv: No Rayleigh scattering, check for NaN in output!' 133 137 do N=1,L_NSPECTV 134 138 TAURAY(N) = 1E-16 -
trunk/LMDZ.GENERIC/libf/phystd/suaer_corrk.F90
r253 r374 4 4 use radinc_h, only: L_NSPECTI,L_NSPECTV,naerkind,nsizemax,iim,jjm 5 5 use radcommon_h, only: blamv,blami,lamrefir,lamrefvis 6 use datafile_mod, only: datadir 6 7 7 8 ! outputs … … 43 44 44 45 #include "callkeys.h" 45 #include "datafile.h"46 46 47 47 ! Optical properties (read in external ASCII files) … … 173 173 ! 1.1 Open the ASCII file 174 174 175 INQUIRE(FILE= datafile(1:LEN_TRIM(datafile))//&176 '/'// file_id(iaer,idomain)(1:LEN_TRIM(file_id(iaer,idomain))),&175 INQUIRE(FILE=TRIM(datadir)//& 176 '/'//TRIM(file_id(iaer,idomain)),& 177 177 EXIST=file_ok) 178 178 IF(.NOT.file_ok) THEN 179 write(*,*)' Problem opening ',&180 file_id(iaer,idomain)(1:LEN_TRIM(file_id(iaer,idomain)))181 write(*,*)'It should be in: ', &182 datafile(1:LEN_TRIM(datafile))183 write(*,*)'1) You can change this directory address in'184 write(*,*)' file phymars/datafile.h'179 write(*,*)'suaer_corrk: Problem opening ',& 180 TRIM(file_id(iaer,idomain)) 181 write(*,*)'It should be in: ',TRIM(datadir) 182 write(*,*)'1) You can set this directory address ',& 183 'in callphys.def with:' 184 write(*,*)' datadir = /absolute/path/to/datagcm' 185 185 write(*,*)'2) If ',& 186 file_id(iaer,idomain)(1:LEN_TRIM(file_id(iaer,idomain))),&186 TRIM(file_id(iaer,idomain)),& 187 187 ' is a LMD reference datafile, it' 188 188 write(*,*)' can be obtained online at:' 189 189 write(*,*)' http://www.lmd.jussieu.fr/',& 190 190 '~forget/datagcm/datafile' 191 write(*,*)'3) If the name of the file is wrong, you can'192 write(*,*)' change it in file phyuniv/suaer_corrk.F90. Just'193 write(*,*)' modify the variable called file_id.'194 191 CALL ABORT 195 192 ENDIF 196 193 OPEN(UNIT=file_unit,& 197 FILE= datafile(1:LEN_TRIM(datafile))//&198 '/'// file_id(iaer,idomain)(1:LEN_TRIM(file_id(iaer,idomain))),&194 FILE=TRIM(datadir)//& 195 '/'//TRIM(file_id(iaer,idomain)),& 199 196 FORM='formatted') 200 197 -
trunk/LMDZ.GENERIC/libf/phystd/sugas_corrk.F90
r368 r374 23 23 use radcommon_h, only : gasv,gasi,FZEROI,FZEROV,gweight 24 24 use radcommon_h, only : wrefvar,gastype 25 25 use datafile_mod, only: datadir 26 26 implicit none 27 27 28 #include "datafile.h"29 28 #include "callkeys.h" 30 29 #include "gases.h" … … 38 37 39 38 character(len=100) :: file_id 40 character(len= 100) :: file_path39 character(len=300) :: file_path 41 40 42 41 real*8 gasi8(L_NTREF,L_NPREF,L_REFVAR,L_NSPECTI,L_NGAUSS) … … 51 50 !======================================================================= 52 51 ! Load variable species data, exit if we have wrong database 53 file_id='/corrk_data/' // corrkdir(1:LEN_TRIM(corrkdir)) // '/Q.dat'54 file_path= datafile(1:LEN_TRIM(datafile))//file_id(1:LEN_TRIM(file_id))52 file_id='/corrk_data/' // TRIM(corrkdir) // '/Q.dat' 53 file_path=TRIM(datadir)//TRIM(file_id) 55 54 56 55 … … 58 57 inquire(FILE=file_path,EXIST=file_ok) 59 58 if(.not.file_ok) then 60 write(*,*)'The file ', file_path(1:LEN_TRIM(file_path))59 write(*,*)'The file ',TRIM(file_path) 61 60 write(*,*)'was not found by sugas_corrk.F90, exiting.' 62 write(*,*)'Check that your path to datagcm in datafile.h is correct and that' 63 write(*,*)'the corrkdir you chose in callphys.def exists.' 61 write(*,*)'Check that your path to datagcm:',trim(datadir) 62 write(*,*)' is correct. You can change it in callphys.def with:' 63 write(*,*)' datadir = /absolute/path/to/datagcm' 64 write(*,*)'Also check that the corrkdir you chose in callphys.def exists.' 64 65 call abort 65 66 endif 66 67 67 68 ! check that database matches varactive toggle 68 open(111,file= file_path(1:LEN_TRIM(file_path)),form='formatted')69 open(111,file=TRIM(file_path),form='formatted') 69 70 read(111,*) ngas 70 71 … … 139 140 ! Set the weighting in g-space 140 141 141 file_id='/corrk_data/' // corrkdir(1:LEN_TRIM(corrkdir)) // '/g.dat'142 file_path= datafile(1:LEN_TRIM(datafile))//file_id(1:LEN_TRIM(file_id))142 file_id='/corrk_data/' // TRIM(corrkdir) // '/g.dat' 143 file_path=TRIM(datadir)//TRIM(file_id) 143 144 144 145 ! check that the file exists 145 146 inquire(FILE=file_path,EXIST=file_ok) 146 147 if(.not.file_ok) then 147 write(*,*)'The file ', file_path(1:LEN_TRIM(file_path))148 write(*,*)'The file ',TRIM(file_path) 148 149 write(*,*)'was not found by sugas_corrk.F90, exiting.' 149 write(*,*)'Check that your path to datagcm in datafile.h is correct and that' 150 write(*,*)'the corrkdir you chose in callphys.def exists.' 150 write(*,*)'Check that your path to datagcm:',trim(datadir) 151 write(*,*)' is correct. You can change it in callphys.def with:' 152 write(*,*)' datadir = /absolute/path/to/datagcm' 153 write(*,*)'Also check that the corrkdir you chose in callphys.def exists.' 151 154 call abort 152 155 endif 153 156 154 157 ! check the array size is correct, load the coefficients 155 open(111,file= file_path(1:LEN_TRIM(file_path)),form='formatted')158 open(111,file=TRIM(file_path),form='formatted') 156 159 read(111,*) L_NGAUSScheck 157 160 if(.not.(L_NGAUSScheck.eq.L_NGAUSS)) then … … 177 180 ! pressure 178 181 179 file_id='/corrk_data/' // corrkdir(1:LEN_TRIM(corrkdir)) // '/p.dat'180 file_path= datafile(1:LEN_TRIM(datafile))//file_id(1:LEN_TRIM(file_id))182 file_id='/corrk_data/' // TRIM(corrkdir) // '/p.dat' 183 file_path=TRIM(datadir)//TRIM(file_id) 181 184 182 185 ! check that the file exists 183 186 inquire(FILE=file_path,EXIST=file_ok) 184 187 if(.not.file_ok) then 185 write(*,*)'The file ', file_path(1:LEN_TRIM(file_path))188 write(*,*)'The file ',TRIM(file_path) 186 189 write(*,*)'was not found by sugas_corrk.F90, exiting.' 190 write(*,*)'Check that your path to datagcm:',trim(datadir) 191 write(*,*)' is correct. You can change it in callphys.def with:' 192 write(*,*)' datadir = /absolute/path/to/datagcm' 193 write(*,*)'Also check that the corrkdir you chose in callphys.def exists.' 187 194 call abort 188 195 endif 189 196 190 197 ! check the array size is correct, load the coefficients 191 open(111,file= file_path(1:LEN_TRIM(file_path)),form='formatted')198 open(111,file=TRIM(file_path),form='formatted') 192 199 read(111,*) L_NPREFcheck 193 200 if(.not.(L_NPREFcheck.eq.L_NPREF)) then … … 222 229 ! temperature 223 230 224 file_id='/corrk_data/' // corrkdir(1:LEN_TRIM(corrkdir)) // '/T.dat'225 file_path= datafile(1:LEN_TRIM(datafile))//file_id(1:LEN_TRIM(file_id))231 file_id='/corrk_data/' // TRIM(corrkdir) // '/T.dat' 232 file_path=TRIM(datadir)//TRIM(file_id) 226 233 227 234 ! check that the file exists 228 235 inquire(FILE=file_path,EXIST=file_ok) 229 236 if(.not.file_ok) then 230 write(*,*)'The file ', file_path(1:LEN_TRIM(file_path))237 write(*,*)'The file ',TRIM(file_path) 231 238 write(*,*)'was not found by sugas_corrk.F90, exiting.' 239 write(*,*)'Check that your path to datagcm:',trim(datadir) 240 write(*,*)' is correct. You can change it in callphys.def with:' 241 write(*,*)' datadir = /absolute/path/to/datagcm' 242 write(*,*)'Also check that the corrkdir you chose in callphys.def exists.' 232 243 call abort 233 244 endif 234 245 235 246 ! check the array size is correct, load the coefficients 236 open(111,file= file_path(1:LEN_TRIM(file_path)),form='formatted')247 open(111,file=TRIM(file_path),form='formatted') 237 248 read(111,*) L_NTREFcheck 238 249 if(.not.(L_NTREFcheck.eq.L_NTREF)) then … … 258 269 259 270 ! VISIBLE 260 if (callgasvis.and..not. corrkdir(1:LEN_TRIM(corrkdir)).eq.'null') then271 if (callgasvis.and..not.TRIM(corrkdir).eq.'null') then 261 272 file_id='/corrk_data/'//trim(adjustl(banddir))//'/corrk_gcm_VI.dat' 262 file_path= datafile(1:LEN_TRIM(datafile))//file_id(1:LEN_TRIM(file_id))273 file_path=TRIM(datadir)//TRIM(file_id) 263 274 264 275 ! check that the file exists 265 276 inquire(FILE=file_path,EXIST=file_ok) 266 277 if(.not.file_ok) then 267 write(*,*)'The file ', file_path(1:LEN_TRIM(file_path))278 write(*,*)'The file ',TRIM(file_path) 268 279 write(*,*)'was not found by sugas_corrk.F90.' 269 280 write(*,*)'Are you sure you have absorption data for these bands?' … … 271 282 endif 272 283 273 open(111,file= file_path(1:LEN_TRIM(file_path)),form='formatted')284 open(111,file=TRIM(file_path),form='formatted') 274 285 read(111,*) gasv8 275 286 close(111) … … 281 292 282 293 ! INFRA-RED 283 if (.not. corrkdir(1:LEN_TRIM(corrkdir)).eq.'null') then294 if (.not.TRIM(corrkdir).eq.'null') then 284 295 file_id='/corrk_data/'//trim(adjustl(banddir))//'/corrk_gcm_IR.dat' 285 file_path= datafile(1:LEN_TRIM(datafile))//file_id(1:LEN_TRIM(file_id))296 file_path=TRIM(datadir)//TRIM(file_id) 286 297 287 298 ! check that the file exists 288 299 inquire(FILE=file_path,EXIST=file_ok) 289 300 if(.not.file_ok) then 290 write(*,*)'The file ', file_path(1:LEN_TRIM(file_path))301 write(*,*)'The file ',TRIM(file_path) 291 302 write(*,*)'was not found by sugas_corrk.F90.' 292 303 write(*,*)'Are you sure you have absorption data for these bands?' … … 294 305 endif 295 306 296 open(111,file= file_path(1:LEN_TRIM(file_path)),form='formatted')307 open(111,file=TRIM(file_path),form='formatted') 297 308 read(111,*) gasi8 298 309 close(111) -
trunk/LMDZ.GENERIC/tmp
r253 r374 3 3 mklsequential 4 4 align 5 common 5 all 6 static
Note: See TracChangeset
for help on using the changeset viewer.