Changeset 3918
- Timestamp:
- Sep 19, 2025, 2:53:16 PM (4 months ago)
- Location:
- trunk/LMDZ.MARS
- Files:
-
- 7 edited
- 1 moved
-
changelog.txt (modified) (1 diff)
-
deftank/launch_1Dchained.sh (modified) (4 diffs)
-
deftank/launch_orb_1Dchained.sh (modified) (6 diffs)
-
deftank/run.def.1d (modified) (1 diff)
-
libf/phymars/dyn1d/init_testphys1d_mod.F90 (modified) (4 diffs)
-
libf/phymars/dyn1d/profile_temp_mod.F90 (moved) (moved from trunk/LMDZ.MARS/libf/phymars/dyn1d/profile.F) (1 diff)
-
libf/phymars/physiq_mod.F (modified) (1 diff)
-
libf/phymars/watercloud_mod.F (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/changelog.txt
r3913 r3918 4973 4973 == 05/09/2025 == JBC 4974 4974 Partial reversion of r3847: removal of the incompatibility test ['activice' requires 'microphys']. Therefore, in "updatereffrad_mod.F", without microphysics, we use a typical value for 'tau' (0.2) to assess the number of cloud condensation nuclei in the same way than done before r744. Comments and unused variables are cleaned. 4975 4976 == 19/09/2025 == JBC 4977 - "profile.F" is transformed into a module "profile_temp_mod.F90" with F90 format. The file "profile" where the temperature is read is renamed into "profile_temp" to avoid any confusion. 4978 - Small corrections and improvements throughout the code and scripts in the deftank. -
trunk/LMDZ.MARS/deftank/launch_1Dchained.sh
r3580 r3918 7 7 8 8 9 echo "The launching script is starting!"10 echo "The output file is \"loglaunch.txt\"."11 if [ "$1" = "bg" ]; then12 date13 else14 nohup "$0" bg > loglaunch.txt 2>&1 &15 exit 116 fi17 18 # Save the current value of LC_NUMERIC and set it to a locale that uses a dot as the decimal separator19 OLD_LC_NUMERIC=$LC_NUMERIC20 LC_NUMERIC=en_US.UTF-821 22 9 ################################################################ 23 10 # Modify here the parameters for the simulation … … 27 14 28 15 # Set the number of Martian years to be simulated: 29 n_myear s=100016 n_myear=100 30 17 31 18 # Name of executable for the PCM: 32 exePCM="testphys1d_ 29_phymars_seq.e"19 exePCM="testphys1d_32_phymars_seq.e" 33 20 ################################################################ 34 21 35 22 36 # Check if files/directories necessary for the script exist 23 echo "The launching script is starting!" 24 echo "The output file is \"launch.log\"." 25 exec > launch.log 2>&1 26 27 # Save the current value of LC_NUMERIC and set it to a locale that uses a dot as the decimal separator 28 OLD_LC_NUMERIC=$LC_NUMERIC 29 LC_NUMERIC=en_US.UTF-8 30 31 # To end the launching script with error 32 errlaunch() { 33 # Restore the previous value of LC_NUMERIC 34 LC_NUMERIC=$OLD_LC_NUMERIC 35 36 date 37 echo "Error: an issue occured in the launching script!" 38 exit 1 39 } 40 41 42 # Check if the set-up is correct 37 43 dir=`pwd` 38 44 machine=`hostname` 39 45 address=`whoami` 46 if [ -v n_myear ]; then 47 if [ $(echo "$n_myear <= 0." | bc -l) -eq 1 ]; then 48 echo "Error: 'n_myear' must be > 0!" 49 errlaunch 50 fi 51 else 52 echo "Error: the number of years to be simulated is not set!" 53 errlaunch 54 fi 40 55 if [ ! -f "$exePCM" ]; then 41 56 echo "Error: file \"$exePCM\" does not exist in $dir!" 42 e xit 157 errlaunch 43 58 fi 44 if [ ! -d " out_PCM" ]; then45 mkdir out_PCM59 if [ ! -d "logs" ]; then 60 mkdir logs 46 61 fi 47 62 if [ ! -d "starts" ]; then … … 56 71 machine=`hostname` 57 72 address=`whoami` 58 echo "This is a chained simulation for PCM runs in $dir on $machine." 59 echo "Number of years to be simulated: $n_myears Martian years." 60 myear=686.9725 # Number of Earth days in Martian year 61 eyear=365.256363004 # Number of days in Earth year 62 convert_years=$(echo "$myear/$eyear" | bc -l) 63 convert_years=$(printf "%.4f" $convert_years) # Rounding to the 4th decimal to respect the precision of Martian year 73 echo "This is a chained simulation for PCM 1D runs in $dir on $machine." 74 echo "Number of years to be simulated: $n_myear Martian years." 64 75 i_myear=0 65 76 iPCM=1 66 cp startfi.nc starts/ 67 if [ -f "star1D.nc" ]; then 68 cp star1D.txt starts/ 77 if [ -f "startfi.nc" ]; then 78 cp startfi.nc starts/ 79 fi 80 if [ -f "start1D.txt" ]; then 81 cp start1D.txt starts/ 69 82 fi 70 83 71 84 # Main loop to to run PCM year by year 72 while [ $i_myear -lt $n_myear s]; do85 while [ $i_myear -lt $n_myear ]; do 73 86 # Run the PCM 74 echo "Run PCM $iPCM: year $iPCM/$n_myears..."75 ./$exePCM > out_runPCM${iPCM}2>&176 if [ ! -f "restartfi.nc" ] ; then # Check if runended abnormally77 echo "Error: the run PCM$iPCM crashed!"78 e xit 187 echo "Run $iPCM: year $iPCM/$n_myear..." 88 ./$exePCM > run.log 2>&1 89 if [ ! -f "restartfi.nc" ] || ! (tail -n 100 run.log | grep -iq "everything is cool!"); then # Check if it ended abnormally 90 echo "Error: the run $iPCM crashed!" 91 errlaunch 79 92 fi 80 93 # Copy data files and prepare the next run 81 mv out_runPCM${iPCM} out_PCM/run${iPCM} 82 mv diagfi.nc diags/diagfi${iPCM}.nc 94 mv run.log logs/run${iPCM}.log 95 if [ -f "diagfi.nc" ]; then 96 mv diagfi.nc diags/diagfi${iPCM}.nc 97 fi 83 98 if [ -f "diagsoil.nc" ]; then 84 99 mv diagsoil.nc diags/diagsoil${iPCM}.nc … … 105 120 106 121 date 107 echo "The launching script ended." 122 echo "Success: the launching script completed normally!" 123 exit 0 -
trunk/LMDZ.MARS/deftank/launch_orb_1Dchained.sh
r3580 r3918 7 7 trap 'echo -e "\033[31mError: an issue occurred in the script on line $LINENO! Please review the command and try again.\033[0m"' ERR 8 8 9 echo "The launching script is starting!"10 echo "The output file is \"loglaunch.txt\"."11 if [ "$1" = "bg" ]; then12 date13 else14 nohup "$0" bg > loglaunch.txt 2>&1 &15 exit 116 fi17 18 # Save the current value of LC_NUMERIC and set it to a locale that uses a dot as the decimal separator19 OLD_LC_NUMERIC=$LC_NUMERIC20 LC_NUMERIC=en_US.UTF-821 9 22 10 ################################################################ … … 27 15 28 16 # Set the number of Earth years before present to start: 29 eyears_bp_ini=-1000 30 31 # Set the number of Martian years to be simulated: 32 n_myears=500 17 year_earth_bp_ini=-100 18 19 # Set the number of years to be simulated, either Martian or Earth years (> 0): 20 n_mars_years=100. 21 #n_earth_years=300 33 22 34 23 # Name of executable for the PCM: 35 exePCM="testphys1d_ 29_phymars_para.e"24 exePCM="testphys1d_32_phymars_seq.e" 36 25 37 26 # Name of the orbital data file: … … 40 29 41 30 42 # Check if files/directories necessary for the script exist 31 echo "The launching script is starting!" 32 echo "The output file is \"launch.log\"." 33 exec > launch.log 2>&1 34 35 # Save the current value of LC_NUMERIC and set it to a locale that uses a dot as the decimal separator 36 OLD_LC_NUMERIC=$LC_NUMERIC 37 LC_NUMERIC=en_US.UTF-8 38 39 # To end the launching script with error 40 errlaunch() { 41 # Restore the previous value of LC_NUMERIC 42 LC_NUMERIC=$OLD_LC_NUMERIC 43 44 date 45 echo "Error: an issue occured in the launching script!" 46 exit 1 47 } 48 49 # To convert Earth years into Mars years 50 convertyears() { 51 myear=686.9725 # Number of Earth days in Martian year 52 eyear=365.256363004 # Number of days in Earth year 53 convert_years=$(echo "$myear/$eyear" | bc -l) 54 convert_years=$(printf "%.4f" $convert_years) # Rounding to the 4th decimal to respect the precision of Martian year 55 if [ -v n_mars_years ]; then 56 n_myear=$n_mars_years 57 echo "Number of years to be simulated: $n_myear Martian years." 58 elif [ -v n_earth_years ]; then 59 n_myear=$(echo "$n_earth_years/$convert_years" | bc -l) 60 echo "Number of years to be simulated: $n_earth_years Earth years = $n_myear Martian years." 61 fi 62 } 63 64 # Check if the set-up is correct 43 65 dir=`pwd` 44 66 machine=`hostname` 45 67 address=`whoami` 68 if [ -v n_mars_years ] && [ ! -z "$n_mars_years" ]; then 69 if [ $(echo "$n_mars_years <= 0." | bc -l) -eq 1 ]; then 70 echo "Error: 'n_mars_years' must be > 0!" 71 errlaunch 72 fi 73 elif [ -v n_earth_years ] && [ ! -z "$n_earth_years" ]; then 74 if [ $(echo "$n_earth_years <= 0." | bc -l) -eq 1 ]; then 75 echo "Error: 'n_earth_years' must be > 0!" 76 errlaunch 77 fi 78 else 79 echo "Error: the number of years to be simulated is not set!" 80 errlaunch 81 fi 46 82 if [ ! -f "$exePCM" ]; then 47 83 echo "Error: file \"$exePCM\" does not exist in $dir!" 48 e xit 184 errlaunch 49 85 fi 50 86 if [ ! -f "$orb_data" ]; then 51 87 echo "Error: file \"$orb_data\" does not exist in $dir!" 52 e xit 188 errlaunch 53 89 fi 54 90 if [ ! -f "startfi.nc" ]; then 55 91 echo "Error: file \"startfi.nc\" does not exist in $dir!" 56 e xit 157 fi 58 if [ ! -d " out_PCM" ]; then59 mkdir out_PCM92 errlaunch 93 fi 94 if [ ! -d "logs" ]; then 95 mkdir logs 60 96 fi 61 97 if [ ! -d "starts" ]; then … … 70 106 machine=`hostname` 71 107 address=`whoami` 72 echo "This is a chained simulation for PCM runs in $dir on $machine." 73 echo "Number of years to be simulated: $n_myears Martian years." 74 myear=686.9725 # Number of Earth days in Martian year 75 eyear=365.256363004 # Number of days in Earth year 76 convert_years=$(echo "$myear/$eyear" | bc -l) 77 convert_years=$(printf "%.4f" $convert_years) # Rounding to the 4th decimal to respect the precision of Martian year 108 echo "This is a chained simulation for PCM 1D runs in $dir on $machine." 109 convertyears 78 110 i_myear=0 79 111 iPCM=1 80 cp startfi.nc starts/ 81 if [ -f "star1D.nc" ]; then 82 cp star1D.txt starts/ 83 fi 84 85 # Main loop to to run PCM year by year 86 while [ $i_myear -lt $n_myears ]; do 112 if [ -f "startfi.nc" ]; then 113 cp startfi.nc starts/ 114 fi 115 if [ -f "start1D.txt" ]; then 116 cp start1D.txt starts/ 117 fi 118 119 # To modify orbital parameters of a file "startfi.nc" 120 modify_startfi_orb() { 87 121 # Get the new values for the orbital parameters 88 yearlask=$(echo "($ eyears_bp_ini + $i_myear*$convert_years)/1000." | bc -l)122 yearlask=$(echo "($year_earth_bp_ini + $i_myear*$convert_years)/1000." | bc -l) 89 123 found=false 90 124 read -r y1 obl1 ecc1 lsp1 < "$orb_data" … … 153 187 echo "New peri_day = $peri_day" 154 188 echo "Done!" 189 } 190 191 192 # Main loop to to run PCM year by year 193 while [ $i_myear -lt $n_myear ]; do 155 194 # Run the PCM 156 echo "Run PCM $iPCM: year $iPCM/$n_myears..."157 ./$exePCM > out_runPCM${iPCM}2>&1158 if [ ! -f "restartfi.nc" ] ; then # Check if runended abnormally159 echo "Error: the run PCM$iPCM crashed!"160 e xit 1195 echo "Run $iPCM: year $iPCM/$n_mars_years..." 196 ./$exePCM > run.log 2>&1 197 if [ ! -f "restartfi.nc" ] || ! (tail -n 100 run.log | grep -iq "everything is cool!"); then # Check if it ended abnormally 198 echo "Error: the run $iPCM crashed!" 199 errlaunch 161 200 fi 162 201 # Copy data files and prepare the next run 163 mv out_runPCM${iPCM} out_PCM/run${iPCM} 164 mv diagfi.nc diags/diagfi${iPCM}.nc 202 mv run.log logs/run${iPCM}.log 203 if [ -f "diagfi.nc" ]; then 204 mv diagfi.nc diags/diagfi${iPCM}.nc 205 fi 165 206 if [ -f "diagsoil.nc" ]; then 166 207 mv diagsoil.nc diags/diagsoil${iPCM}.nc … … 187 228 188 229 date 189 echo "The launching script ended." 230 echo "Success: the launching script completed normally!" 231 exit 0 -
trunk/LMDZ.MARS/deftank/run.def.1d
r3912 r3918 57 57 # Relaxation time (s). If <0 then no time relaxation i.e. forcing 58 58 relaxtime_h2oice=-1. 59 60 59 # hybrid vertical coordinate ? (.true. for hybrid and .false. for sigma levels) 61 60 hybrid=.true. 62 61 63 62 ###### Initial atmospheric temperature profile 63 # It matters only if there is no "start1D.txt" 64 64 # 65 65 # Type of initial temperature profile -
trunk/LMDZ.MARS/libf/phymars/dyn1d/init_testphys1d_mod.F90
r3912 r3918 19 19 use infotrac, only: nqtot, tname, nqperes, nqfils 20 20 use read_profile_mod, only: read_profile 21 use profile_temp_mod, only: profile_temp 21 22 use iostart, only: open_startphy, get_var, close_startphy 22 23 use physics_distribution_mod, only: init_physics_distribution … … 93 94 integer :: dayn ! Final date 94 95 real, dimension(nlayer) :: zlay ! altitude estimee dans les couches (km) 95 real, dimension(0:nlayer) :: tmp1, tmp296 real, dimension(0:nlayer) :: zkm, teta 96 97 97 98 ! Dummy variables along "dynamics scalar grid" … … 655 656 pks = psurf**rcp 656 657 657 ! Altitude in km in profile: divide zlay by 1000658 tmp1(0) = 0.659 tmp1(1:) = zlay/1000.660 661 call profile(nlayer + 1,tmp1,tmp2)662 663 658 if (.not. therestart1D) then 664 tsurf = tmp2(0) 665 temp = tmp2(1:) 659 ! Altitude in km in "profile_temp": divide zlay by 1000 660 zkm(0) = 0. 661 zkm(1:) = zlay/1000. 662 663 call profile_temp(nlayer + 1,zkm,teta) 664 tsurf = teta(0) 665 temp = teta(1:) 666 666 else 667 667 read(3,*) header, (tsurf(1,j), j = 1,size(tsurf,2)), (temp(ilayer), ilayer = 1,nlayer) … … 745 745 flux_geo = flux_geo(1,1) 746 746 747 748 747 ! Initialize traceurs 749 748 ! ------------------- -
trunk/LMDZ.MARS/libf/phymars/dyn1d/profile_temp_mod.F90
r3917 r3918 1 ! SUBROUTINE profile(unit,nlev,zkm,temp) 2 SUBROUTINE profile(nlev,zkm,temp) 3 ! to use 'getin' 4 USE ioipsl_getincom 5 IMPLICIT NONE 6 c======================================================================= 7 c Subroutine utilisee dans le modele 1-D "testphys1d" 8 c pour l'initialisation du profil atmospherique 9 c======================================================================= 10 c 11 c differents profils d'atmospheres. T=f(z) 12 c entree: 13 c nlev nombre de niveaux 14 c zkm alititudes en km 15 c ichoice choix de l'atmosphere: 16 c 1 Temperature constante 17 c 2 profil Savidjari 18 c 3 Lindner (profil polaire) 19 c 4 Inversion pour Francois 20 c 5 Seiff (moyen) 21 c 6 T constante + perturbation gauss (level) (christophe 10/98) 22 c 7 T constante + perturbation gauss (km) (christophe 10/98) 23 c 8 Lecture du profile dans un fichier ASCII (profile) 24 c tref temperature de reference 25 c isin ajout d'une perturbation (isin=1) 26 c pic pic perturbation gauss pour ichoice = 6 ou 7 27 c largeur largeur de la perturbation gauss pour ichoice = 6 ou 7 28 c hauteur hauteur de la perturbation gauss pour ichoice = 6 ou 7 29 c 30 c sortie: 31 c temp temperatures en K 32 c 33 c======================================================================= 34 c----------------------------------------------------------------------- 35 c declarations: 36 c ------------- 37 38 c arguments: 39 c ---------- 40 41 INTEGER nlev 42 REAL zkm(nlev),temp(nlev) 43 44 c local: 45 c ------ 46 47 INTEGER il,ichoice,nseiff,iseiff,isin,iter 48 REAL pi 49 PARAMETER(nseiff=37) 50 REAL tref,t1,t2,t3,ww 51 REAL tseiff(nseiff) 52 DATA tseiff/214.,213.8,213.4,212.4,209.3,205.,201.4,197.8, 53 $ 194.6,191.4,188.2,185.2,182.5,180.,177.5,175, 54 $ 172.5,170.,167.5,164.8,162.4,160.,158.,156., 55 $ 154.1,152.2,150.3,148.7,147.2,145.7,144.2,143., 56 $ 142.,141.,140,139.5,139./ 57 REAL pic,largeur 58 REAL hauteur,tmp 59 60 c----------------------------------------------------------------------- 61 c read input profile type: 62 c-------------------------- 63 64 ichoice=1 ! default value for ichoice 65 call getin("ichoice",ichoice) 66 tref=200 ! default value for tref 67 call getin("tref",tref) 68 isin=0 ! default value for isin (=0 means no perturbation) 69 call getin("isin",isin) 70 pic=26.522 ! default value for pic 71 call getin("pic",pic) 72 largeur=10 ! default value for largeur 73 call getin("largeur",largeur) 74 hauteur=30 ! default value for hauteur 75 call getin("hauteur",hauteur) 76 77 c----------------------------------------------------------------------- 78 c ichoice=1 temperature constante: 79 c -------------------------------- 80 81 IF(ichoice.EQ.1) THEN 82 DO il=1,nlev 83 temp(il)=tref 84 ENDDO 85 86 c----------------------------------------------------------------------- 87 c ichoice=2 savidjari: 88 c -------------------- 89 90 ELSE IF(ichoice.EQ.2) THEN 91 DO il=1,nlev 92 temp(il)=AMAX1(219.-2.5*zkm(il),140.) 93 ENDDO 94 95 c----------------------------------------------------------------------- 96 c ichoice=3 Lindner: 97 c ------------------ 98 99 ELSE IF(ichoice.EQ.3) THEN 100 DO il=1,nlev 101 IF(zkm(il).LT.2.5) THEN 102 temp(il)=150.+30.*zkm(il)/2.5 103 ELSE IF(zkm(il).LT.5.) THEN 104 temp(il)=180. 105 ELSE 106 temp(il)=AMAX1(180.-2.*(zkm(il)-5.),130.) 107 ENDIF 108 ENDDO 109 110 c----------------------------------------------------------------------- 111 c ichoice=4 Inversion pour Francois: 112 c ------------------ 113 114 ELSE IF(ichoice.EQ.4) THEN 115 DO il=1,nlev 116 IF(zkm(il).LT.20.) THEN 117 temp(il)=135. 118 ELSE 119 temp(il)=AMIN1(135.+5.*(zkm(il)-20.),200.) 120 ENDIF 121 ENDDO 122 123 124 c----------------------------------------------------------------------- 125 c ichoice=5 Seiff: 126 c ---------------- 127 128 ELSE IF(ichoice.EQ.5) THEN 129 DO il=1,nlev 130 iseiff=INT(zkm(il)/2.)+1 131 IF(iseiff.LT.nseiff-1) THEN 132 temp(il)=tseiff(iseiff)+(zkm(il)-2.*(iseiff-1))* 133 $ (tseiff(iseiff+1)-tseiff(iseiff))/2. 134 ELSE 135 temp(il)=tseiff(nseiff) 136 ENDIF 137 ENDDO 138 c IF(ichoice.EQ.6) THEN 139 c DO iter=1,6 140 c t2=temp(1) 141 c t3=temp(2) 142 c DO il=2,nlev-1 143 c t1=t2 144 c t2=t3 145 c t3=temp(il+1) 146 c ww=tanh(zkm(il)/20.) 147 c ww=ww*ww*ww 148 c temp(il)=t2+ww*.5*(t1-2.*t2+t3) 149 c ENDDO 150 c ENDDO 151 c ENDIF 152 153 c----------------------------------------------------------------------- 154 c ichoice=6 155 c --------- 156 157 ELSE IF(ichoice.EQ.6) THEN 158 DO il=1,nlev 1 MODULE profile_temp_mod 2 3 implicit none 4 5 CONTAINS 6 7 SUBROUTINE profile_temp(nlev,zkm,temp) 8 9 use ioipsl_getincom, only: getin ! To use 'getin' 10 use comcstfi_h, only: pi 11 12 IMPLICIT NONE 13 14 !======================================================================= 15 ! Subroutine utilisee dans le modele 1-D "testphys1d" 16 ! pour l'initialisation du profil atmospherique 17 !======================================================================= 18 ! 19 ! differents profils d'atmospheres. T=f(z) 20 ! entree: 21 ! nlev nombre de niveaux 22 ! zkm alititudes en km 23 ! ichoice choix de l'atmosphere: 24 ! 1 Temperature constante 25 ! 2 profil Savidjari 26 ! 3 Lindner (profil polaire) 27 ! 4 Inversion pour Francois 28 ! 5 Seiff (moyen) 29 ! 6 T constante + perturbation gauss (level) (christophe 10/98) 30 ! 7 T constante + perturbation gauss (km) (christophe 10/98) 31 ! 8 Lecture du profile dans un fichier ASCII (profile_temp) 32 ! tref temperature de reference 33 ! isin ajout d'une perturbation (isin=1) 34 ! pic pic perturbation gauss pour ichoice = 6 ou 7 35 ! largeur largeur de la perturbation gauss pour ichoice = 6 ou 7 36 ! hauteur hauteur de la perturbation gauss pour ichoice = 6 ou 7 37 ! 38 ! sortie: 39 ! temp temperatures en K 40 ! 41 !======================================================================= 42 !----------------------------------------------------------------------- 43 ! declarations: 44 ! ------------- 45 46 ! arguments: 47 ! ---------- 48 49 INTEGER, intent(in) :: nlev 50 REAL, dimension(nlev), intent(in) :: zkm 51 REAL, dimension(nlev), intent(out) :: temp 52 53 ! local: 54 ! ------ 55 56 INTEGER :: il,ichoice,iseiff,isin,iter,ierr 57 INTEGER, PARAMETER :: nseiff = 37 58 REAL :: tref,t1,t2,t3,ww 59 REAL, dimension(nseiff) :: tseiff 60 DATA tseiff/214. ,213.8,213.4,212.4,209.3,205. ,201.4,197.8, & 61 194.6,191.4,188.2,185.2,182.5,180. ,177.5,175 , & 62 172.5,170. ,167.5,164.8,162.4,160. ,158. ,156. , & 63 154.1,152.2,150.3,148.7,147.2,145.7,144.2,143. , & 64 142. ,141. ,140 ,139.5,139./ 65 REAL :: pic,largeur 66 REAL :: hauteur,tmp 67 68 !----------------------------------------------------------------------- 69 ! read input profile type: 70 !-------------------------- 71 72 ichoice=1 ! default value for ichoice 73 call getin("ichoice",ichoice) 74 tref=200 ! default value for tref 75 call getin("tref",tref) 76 isin=0 ! default value for isin (=0 means no perturbation) 77 call getin("isin",isin) 78 pic=26.522 ! default value for pic 79 call getin("pic",pic) 80 largeur=10 ! default value for largeur 81 call getin("largeur",largeur) 82 hauteur=30 ! default value for hauteur 83 call getin("hauteur",hauteur) 84 85 !----------------------------------------------------------------------- 86 ! ichoice=1 temperature constante: 87 ! -------------------------------- 88 89 IF(ichoice.EQ.1) THEN 90 DO il=1,nlev 91 temp(il)=tref 92 ENDDO 93 94 !----------------------------------------------------------------------- 95 ! ichoice=2 savidjari: 96 ! -------------------- 97 98 ELSE IF(ichoice.EQ.2) THEN 99 DO il=1,nlev 100 temp(il)=AMAX1(219.-2.5*zkm(il),140.) 101 ENDDO 102 103 !----------------------------------------------------------------------- 104 ! ichoice=3 Lindner: 105 ! ------------------ 106 107 ELSE IF(ichoice.EQ.3) THEN 108 DO il=1,nlev 109 IF(zkm(il).LT.2.5) THEN 110 temp(il)=150.+30.*zkm(il)/2.5 111 ELSE IF(zkm(il).LT.5.) THEN 112 temp(il)=180. 113 ELSE 114 temp(il)=AMAX1(180.-2.*(zkm(il)-5.),130.) 115 ENDIF 116 ENDDO 117 118 !----------------------------------------------------------------------- 119 ! ichoice=4 Inversion pour Francois: 120 ! ------------------ 121 122 ELSE IF(ichoice.EQ.4) THEN 123 DO il=1,nlev 124 IF(zkm(il).LT.20.) THEN 125 temp(il)=135. 126 ELSE 127 temp(il)=AMIN1(135.+5.*(zkm(il)-20.),200.) 128 ENDIF 129 ENDDO 130 131 !----------------------------------------------------------------------- 132 ! ichoice=5 Seiff: 133 ! ---------------- 134 135 ELSE IF(ichoice.EQ.5) THEN 136 DO il=1,nlev 137 iseiff=INT(zkm(il)/2.)+1 138 IF(iseiff.LT.nseiff-1) THEN 139 temp(il)=tseiff(iseiff)+(zkm(il)-2.*(iseiff-1))*(tseiff(iseiff+1)-tseiff(iseiff))/2. 140 ELSE 141 temp(il)=tseiff(nseiff) 142 ENDIF 143 ENDDO 144 ! IF(ichoice.EQ.6) THEN 145 ! DO iter=1,6 146 ! t2=temp(1) 147 ! t3=temp(2) 148 ! DO il=2,nlev-1 149 ! t1=t2 150 ! t2=t3 151 ! t3=temp(il+1) 152 ! ww=tanh(zkm(il)/20.) 153 ! ww=ww*ww*ww 154 ! temp(il)=t2+ww*.5*(t1-2.*t2+t3) 155 ! ENDDO 156 ! ENDDO 157 !ENDIF 158 159 !----------------------------------------------------------------------- 160 ! ichoice=6 161 ! --------- 162 163 ELSE IF(ichoice.EQ.6) THEN 164 DO il=1,nlev 159 165 tmp=il-pic 160 166 temp(il)=tref + hauteur*exp(-tmp*tmp/largeur/largeur) 161 ENDDO 162 163 164 c----------------------------------------------------------------------- 165 c ichoice=7 166 c --------- 167 168 ELSE IF(ichoice.EQ.7) THEN 169 DO il=1,nlev 167 ENDDO 168 169 !----------------------------------------------------------------------- 170 ! ichoice=7 171 ! --------- 172 173 ELSE IF(ichoice.EQ.7) THEN 174 DO il=1,nlev 170 175 tmp=zkm(il)-pic 171 176 temp(il)=tref + hauteur*exp(-tmp*tmp*4/largeur/largeur) 172 ENDDO 173 174 c----------------------------------------------------------------------- 175 c ichoice=8 176 c --------- 177 178 ELSE IF(ichoice.GE.8) THEN 179 OPEN(11,file='profile',status='old',form='formatted',err=101) 180 DO il=1,nlev 181 READ (11,*) temp(il) 182 ENDDO 183 184 GOTO 201 185 101 STOP'fichier profile inexistant' 186 201 CONTINUE 187 CLOSE(10) 188 189 c----------------------------------------------------------------------- 190 191 ENDIF 192 193 c----------------------------------------------------------------------- 194 c rajout eventuel d'une perturbation: 195 c ----------------------------------- 196 197 IF(isin.EQ.1) THEN 198 pi=2.*ASIN(1.) 199 DO il=1,nlev 200 c if (nlev.EQ.501) then 201 c if (zkm(il).LE.70.5) then 202 c temp(il)=temp(il)+(1.-1000./(1000+zkm(il)*zkm(il)))*( 203 c s 6.*SIN(zkm(il)*pi/6.)+9.*SIN(zkm(il)*pi/10.3) ) 204 c endif 205 c else 206 temp(il)=temp(il)+(1.-1000./(1000+zkm(il)*zkm(il)))*( 207 s 6.*SIN(zkm(il)*pi/6.)+9.*SIN(zkm(il)*pi/10.3) ) 208 c endif 209 ENDDO 210 ENDIF 211 212 213 c----------------------------------------------------------------------- 214 c Ecriture du profil de temperature dans un fichier profile.out 215 c ------------------------------------------------------------- 216 217 218 OPEN(12,file='profile.out',form='formatted') 219 DO il=1,nlev 220 write(12,*) temp(il) 221 ENDDO 222 CLOSE(12) 223 224 RETURN 225 END 177 ENDDO 178 179 !----------------------------------------------------------------------- 180 ! ichoice=8 181 ! --------- 182 183 ELSE IF(ichoice.GE.8) THEN 184 OPEN(11,file='profile_temp',status='old',form='formatted',iostat=ierr) 185 if (ierr == 0) then 186 DO il=1,nlev 187 READ (11,*) temp(il) 188 ENDDO 189 else 190 error stop 'File "profile_temp" not found!' 191 endif 192 CLOSE(11) 193 194 !----------------------------------------------------------------------- 195 ENDIF 196 197 !----------------------------------------------------------------------- 198 ! rajout eventuel d'une perturbation: 199 ! ----------------------------------- 200 201 IF (isin.EQ.1) THEN 202 DO il=1,nlev 203 ! if (nlev.EQ.501) then 204 ! if (zkm(il).LE.70.5) then 205 ! temp(il)=temp(il)+(1.-1000./(1000+zkm(il)*zkm(il)))*( 6.*SIN(zkm(il)*pi/6.)+9.*SIN(zkm(il)*pi/10.3) ) 206 ! endif 207 ! else 208 temp(il)=temp(il)+(1.-1000./(1000+zkm(il)*zkm(il)))*( 6.*SIN(zkm(il)*pi/6.)+9.*SIN(zkm(il)*pi/10.3) ) 209 ! endif 210 ENDDO 211 ENDIF 212 213 !----------------------------------------------------------------------- 214 ! Ecriture du profil de temperature dans un fichier profile_temp.out 215 ! ------------------------------------------------------------------ 216 217 OPEN(12,file='profile_temp.out',status='unknown',form='formatted') 218 DO il=1,nlev 219 write(12,*) temp(il) 220 ENDDO 221 CLOSE(12) 222 223 END SUBROUTINE profile_temp 224 225 END MODULE profile_temp_mod -
trunk/LMDZ.MARS/libf/phymars/physiq_mod.F
r3904 r3918 697 697 inertiedat(:,:)=400. 698 698 inertiesoil(:,:,:)=400. 699 write(*,*) "Physiq: initializing day_ini to pda t!"699 write(*,*) "Physiq: initializing day_ini to pday !" 700 700 day_ini=pday 701 701 endif -
trunk/LMDZ.MARS/libf/phymars/watercloud_mod.F
r3902 r3918 696 696 #ifndef MESOSCALE 697 697 c======================================================================= 698 call write_output("watercloud_pdqh2oice","pdqcloud_h2o_ice "//699 & "after microphysics","kg/kg.s-1",pdqcloud(:,:,igcm_h2o_ice))700 call write_output("watercloud_pdqh2ovap","pdqcloud_h2o_vap "//701 & "after microphysics","kg/kg.s-1",pdqcloud(:,:,igcm_h2o_vap))702 if (hdo) then703 call write_output("watercloud_pdqhdoice","pdqcloud_hdo_ice "//704 & "after microphysics","kg/kg.s-1",pdqcloud(:,:,igcm_hdo_ice))705 call write_output("watercloud_pdqhdovap","pdqcloud_hdo_vap "//706 & "after microphysics","kg/kg.s-1",pdqcloud(:,:,igcm_hdo_vap))707 endif708 698 ! call write_output("pdqccn2","pdqcloudccn apres microphysique" 709 699 ! & ,"kg/kg.s-1",pdqcloud(:,:,
Note: See TracChangeset
for help on using the changeset viewer.
