Changeset 1366 for trunk/UTIL
- Timestamp:
- Nov 7, 2014, 11:11:45 AM (10 years ago)
- Location:
- trunk/UTIL
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTIL/compile
r1360 r1366 4 4 # > compile zrecast 5 5 6 # pgf90 -Bstatic $1.F90 \ 7 #-I/distrib/local/netcdf/pgi_7.1-6_32/include \ 8 #-L/distrib/local/netcdf/pgi_7.1-6_32/lib -lnetcdf -o $1.e 6 # pgf sur les machines du LMD: 7 #----------------------------- 8 #pgf95 -Bstatic $1.F90 \ 9 #-I/distrib/local/netcdf/pgi_7.1-6_64/include \ 10 #-L/distrib/local/netcdf/pgi_7.1-6_64/lib -lnetcdf -o $1.e 9 11 10 # ifort $1.F90 \11 # pgf90 $1.F90 \12 # ifort 13 #------ 12 14 ifort $1.F90 \ 13 15 -I$NETCDF/include \ 14 16 -L$NETCDF/lib -lnetcdf -o $1.e 15 17 18 #----------------------------------------------------------------- 16 19 # Before running that on you computer you might want to change : 20 #----------------------------------------------------------------- 17 21 # 1) replace "pgf90" with the name of your favorite compiler 18 22 # (you may also add some non-agressive optimization options e.g. -O2) -
trunk/UTIL/zrecast.F90
r1363 r1366 5 5 real :: g0 ! gravity at a0 (Mars: g0=3.7257964 ; Lemoine et al. 2001) 6 6 real :: R0 ! reduced gaz constant (Mars: R=191) 7 character(len=20) :: planet 7 8 end module planet_const 8 9 … … 1714 1715 stop 1715 1716 endif 1716 else ! hybrid coordinates1717 elseif (have_hyb) then ! hybrid coordinates 1717 1718 ierr=NF_PUT_VAR_REAL(outfid,aps_varid,aps) 1718 1719 if (ierr.ne.NF_NOERR) then … … 2016 2017 ! initialize planetary constants using the "controle" array in the file 2017 2018 ! if "controle" array not found in file, look for it in "diagfi.nc" 2019 ! if still no "controle" array nowhere, ask for planet name 2020 2018 2021 use planet_const 2019 2022 use netcdf … … 2028 2031 integer :: infid2 ! for an alternate input file 2029 2032 real :: controle(100) ! to store "controle" array 2033 logical :: have_ctl 2034 2035 planet="dunno" 2036 have_ctl=.false. 2030 2037 2031 2038 ! look for "controle" in input file … … 2033 2040 varname="controle" 2034 2041 status=nf90_inq_varid(infid,trim(varname),varid) 2035 if (status.ne.nf90_noerr) then 2042 2043 if (status.eq.nf90_noerr) then 2044 write(*,*) "OK, found ",trim(varname) 2045 have_ctl=.true. 2046 else 2036 2047 write(*,*) "init_planet_const: Failed to find ",trim(varname) 2037 2048 write(*,*) " looking for it in file diagfi.nc" 2038 2049 status=nf90_open("diagfi.nc",NF90_NOWRITE,infid2) 2039 if (status.ne.nf90_noerr) then 2050 if (status.eq.nf90_noerr) then 2051 status=nf90_inq_varid(infid2,trim(varname),varid) 2052 if (status.eq.nf90_noerr) then 2053 write(*,*) "OK, found ",trim(varname) 2054 have_ctl=.true. 2055 else 2056 write(*,*) " Failed to find ",trim(varname)," in file!!" 2057 endif 2058 else 2040 2059 write(*,*) " no diafi.nc file ... looking for diagfi1.nc" 2041 2060 status=nf90_open("diagfi1.nc",NF90_NOWRITE,infid2) 2042 if (status.ne.nf90_noerr) then 2043 write(*,*) "might as well stop here..." 2044 stop 2061 if (status.eq.nf90_noerr) then 2062 status=nf90_inq_varid(infid2,trim(varname),varid) 2063 if (status.eq.nf90_noerr) then 2064 write(*,*) "OK, found ",trim(varname) 2065 have_ctl=.true. 2066 else 2067 write(*,*) " Failed to find ",trim(varname)," in file!!" 2068 endif 2045 2069 endif 2046 2070 endif 2047 status=nf90_inq_varid(infid2,trim(varname),varid) 2071 endif 2072 2073 if (have_ctl) then 2074 status=nf90_get_var(infid2,varid,controle) 2048 2075 if (status.ne.nf90_noerr) then 2049 write(*,*) " Failed to find ",trim(varname)," in file!!"2076 write(*,*) "init_planet_const: Failed to load ",trim(varname) 2050 2077 stop 2051 2078 endif 2052 write(*,*) "OK, found ",trim(varname) 2079 ! now that we have "controle"; extract relevent informations 2080 a0=controle(5) ! = radius of planet (m) 2081 g0=controle(7) ! = gravity (m.s-2) at a0 2082 R0=1000.*8.314511/controle(8) ! controle(8)=mugaz = molar mass (g.mol-1) of atm. 2083 else 2084 write(*,*) "No controle found." 2085 write(*,*) "You need to tell me on which planet we are:" 2086 read(*,'(a20)') planet 2087 write(*,*) "" 2088 if (trim(planet).eq."titan") then 2089 a0=2575.E3 ! = radius of planet (m) 2090 g0=1.35 ! = gravity (m.s-2) at a0 2091 R0=296.9 ! = molecular gas constant 2092 else if (trim(planet).eq."venus") then 2093 a0=6051.E3 ! = radius of planet (m) 2094 g0=8.87 ! = gravity (m.s-2) at a0 2095 R0=191.4 ! = molecular gas constant 2096 else 2097 write(*,*) "init_planet_const: Failed to init ",trim(planet), & 2098 " constants..." 2099 stop 2100 endif 2053 2101 endif 2054 status=nf90_get_var(infid2,varid,controle)2055 if (status.ne.nf90_noerr) then2056 write(*,*) "init_planet_const: Failed to load ",trim(varname)2057 stop2058 endif2059 2060 ! now that we have "controle"; extract relevent informations2061 a0=controle(5) ! = radius of planet (m)2062 g0=controle(7) ! = gravity (m.s-2) at a02063 R0=1000.*8.314511/controle(8) ! controle(8)=mugaz = molar mass (g.mol-1) of atm.2064 2102 2065 2103 end subroutine init_planet_const
Note: See TracChangeset
for help on using the changeset viewer.