- Timestamp:
- Jun 5, 2013, 2:41:09 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 8 deleted
- 22 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/DOC/chantiers/commit_importants.log
r841 r979 1168 1168 Now dynamics in seq/MPI/OpenMP/mixed modes yield identical results when 1169 1169 running in Newtonian mode (i.e. dynamics only). 1170 1171 ********************* 1172 **** commit_v979 **** 1173 ********************* 1174 Ehouarn: Updates in the dynamics (seq and //) to keep up with updates 1175 in LMDZ5 (up to LMDZ5 trunk, rev 1760): 1176 * General stuff (essentially to keep up with Earth model): 1177 - Updated makelmdz_fcm and makelmdz (more control on dimension.h, 1178 added option -mem, although it is not usefull for now) 1179 - Updated build_gcm with more control over fcm 1180 - Updated create_make_gcm (enable looking for code in subdirectories) 1181 1182 * bibio: 1183 - updates (just renaming the files actually...) new_unit.F90 => new_unit_m.F90, 1184 pchsp_95.F90 => pchsp_95_m.F90 and pchfe_95.F90 => pchfe_95_m.F90 1185 1186 * filtrez: 1187 - mod_fft.F90: use more baseline CPP directives for preprocessor compatibility 1188 - mod_filtre_fft_loc.F90: added this new file 1189 - filtreg_mod.f90: added calls to init_..._loc 1190 - filtreg.F: fixed calls to DGEMM into SGEMM (preprocessing does the switch) 1191 1192 * dyn3d: 1193 - removed obsolete files: etat0_netcdf.F90 limit_netcdf.F90 1194 pres2lev.F90 1195 - added new file : pres2lev_mod.F90 (module containing "old" pres2lev) 1196 - gcm.F: changed args to call to inidissip (added arg "vert_prof_dissip") 1197 - inidissip.F90: added arg "vert_prof_dissip" and the "earth model" 1198 discterizations (flagged with "planet_type=="earth") 1199 - comdissnew.h: added 'vert_prof_dissip' to the common block 1200 - guide_mod.F90: added the "use pres2lev_mod" 1201 - conf_gcm.F: cosmetics, and evaluation of vert_prof_dissip, 1202 (and also of dissip_* factors, for Earth model) 1203 - comconst.h : added dissip_factz,dissip_zref variables (for Earth mode dissip) 1204 1205 * dyn3dpar: 1206 - removed obsolete files: etat0_netcdf.F90 limit_netcdf.F90 1207 pres2lev.F90 mod_const_para.F90 1208 - added new files: pres2lev_mod.F90 (module containing "old" pres2lev) 1209 mod_const_mpi 1210 - abort_gcm : better control of abort in parallel mode 1211 - gcm.F: changed args to call to inidissip (added arg "vert_prof_dissip") 1212 - inidissip.F90: added arg "vert_prof_dissip" and the "earth model" 1213 discterizations (flagged with "planet_type=="earth") 1214 - comdissnew.h: added 'vert_prof_dissip' to the common block 1215 - filtreg_p.F : bug correction (array bounds) 1216 - guide_p_mod.F90 : added the "use pres2lev_mod" 1217 - conf_gcm.F : cosmetics (and evaluation of vert_prof_dissip , and 1218 also of dissip_* factors, for Earth model) 1219 plus check if "adjust" is indeed not used in OpenMP 1220 - comconst.h : add dissip_factz,dissip_zref variables (for Earth mode dissip) -
trunk/DOC/chantiers/meschantiers-Ehouarn.txt
r895 r979 14 14 15 15 - dernière mise à jour des dynamiques (par rapport au trunk de LMDZ5 16 "Terrestre" rev. 1 678) avec la rev 841.16 "Terrestre" rev. 1760) avec la rev 979. 17 17 Reste à faire l'exercice de validation des modifs en //... 18 18 Avec rev 841 et 843 Cp(T) en // OK 19 19 Reste toutefois à paufiner les choses au niveau de calfis_p et des 20 20 domaines d'utilisation de tpot2t_p et t2tpot_p (toutes les taches MPI 21 font l'intégralité du travail!) 21 font l'intégralité du travail!). OK. 22 22 23 23 - Faire qu'on puisse compiler un exécutable qui serait dans la physique -
trunk/LMDZ.COMMON/build_gcm
r843 r979 1 1 #!/bin/bash 2 # Usage: 3 # ./build_gcm [path] 4 # where 'path' is an optional argument to this script specifying 5 # the full path to where the 'fcm' command is to be found 2 6 3 if [[ -f '.lock' ]] ; then 4 echo 'ATTENTION: vous etes sans doute en train de compiler le modele par ailleurs' 5 echo "Attendez que la premiere compilation soit terminee pour relancer la suivante." 6 echo "Si vous etes sur que vous ne compilez pas le modele par ailleurs," 7 echo vous pouvez continuer en repondant oui. 8 echo "Voulez-vous vraiment continuer?" 9 read -p "" answer 10 if [[ $answer != "oui" ]] ; then 7 if test -f '.lock' 8 then 9 echo 'ATTENTION: vous etes sans doute en train de compiler le modele par ailleurs' 10 echo "Attendez que la premiere compilation soit terminee pour relancer la suivante." 11 echo "Si vous etes sur que vous ne compilez pas le modele par ailleurs," 12 echo "vous pouvez continuer en repondant oui." 13 echo "Voulez-vous vraiment continuer?" 14 echo "" 15 echo "WARNING: you are probably already compiling the model somewhere else." 16 echo "Wait until the first compilation is finished before launching this one." 17 echo "If you are sure that you are not compiling elsewhere, just answer " 18 echo "yes (or 'oui') to the question below to proceed." 19 echo "Do you wish to continue?" 20 read ouinon 21 if [[ $ouinon == "oui" || $ouinon == "yes" ]] 22 then 23 echo OK 24 else 25 exit 26 fi 27 else 28 echo "compiling..." > '.lock' 29 fi 30 31 dirname="" #path to where the fcm command will be found 32 if (( $# >= 1 )) ; then 33 dirname=$1 34 # check that "dirname" exists and is a directory 35 if [[ ! -d $dirname ]] ; then 36 echo "$0 error : $dirname is not a directory" 11 37 exit 12 38 fi 13 else14 echo "compilation en cours..." > '.lock'39 # add a trailing "/" to $dirname 40 dirname=${dirname}"/" 15 41 fi 16 42 17 fcm build 43 # run "fcm build" command 44 ${dirname}fcm build 18 45 46 # cleanup 19 47 \rm -f '.lock' 48 -
trunk/LMDZ.COMMON/create_make_gcm
r814 r979 4 4 # 5 5 #set -xv 6 7 rm -f create_make_gcm.log 8 6 9 machine=`hostname` 7 10 os=`uname` … … 134 137 do 135 138 if [ -d $diri ] ; then 136 if [ "`ls $diri/*.F `" != "" ] || [ "`ls $diri/*.F90`" != "" ] ; then137 cd $diri >/dev/null 2>&1139 if [ "`ls $diri/*.F $diri/*/*.F`" != "" ] || [ "`ls $diri/*.F90 $diri/*/*.F90`" != "" ] ; then 140 # cd $diri >/dev/null 2>&1 138 141 echo 139 142 listlib="" 140 for i in `ls *.F` 141 do142 fili=`basename $i .F`143 # Liste des fichiers .F et .F90 n'etant pas des programmes principaux 144 for fili in `ls $diri/*.F $diri/*/*.F` 145 do 143 146 # Check if file is a routine or main program 144 147 # i.e: look for the "program" keword preceeded by leading spaces 145 test=` ( head $ i | grep -i '^ *program' ) `148 test=` ( head $fili | grep -i '^ *program' ) ` 146 149 if [ "$test" = "" ] ; then 147 150 # if it is not a main program, add it to the list … … 149 152 fi 150 153 done 151 for i in `ls *.F90` 152 do 153 fili=`basename $i .F90` 154 for fili in `ls $diri/*.F90 $diri/*/*.F90` 155 do 154 156 # Check if file is a routine or main program 155 157 # i.e. look for "program" keyword (with possibly some leading spaces) 156 test=` ( head $ i | grep -i '^ \{0,\}program' ) `158 test=` ( head $fili | grep -i '^ \{0,\}program' ) ` 157 159 if [ "$test" = "" ] ; then 158 160 # if it is not a main program, add it to the list … … 162 164 # 163 165 echo 166 echo $listlib >> create_make_gcm.log 164 167 echo 165 168 echo "#=======================================================================" … … 167 170 echo "#=======================================================================" 168 171 echo 169 for fili in $listlib 170 do 172 for trufile in $listlib 173 do 174 fili=`echo $trufile | awk -F/ ' { print $NF } ' | cut -d. -f1` 171 175 echo '$(LIBO)/lib'$diri".a : " '$(LIBO)/lib'$diri".a("$fili".o)" 172 176 echo … … 177 181 echo "# Compilation des membres de la bibliotheque lib"$diri".a" 178 182 echo 179 for fili in $listlib 180 do 181 if [ -f $fili.F90 ] ; then 182 trufile=$fili.F90 183 else 184 trufile=$fili.F 185 fi 183 for trufile in $listlib 184 do 185 # if [ -f $fili.F90 ] ; then 186 # trufile=$fili.F90 187 # else 188 # trufile=$fili.F 189 # fi 190 fili=`echo $trufile | awk -F/ ' { print $NF } ' | cut -d. -f1` 186 191 F90=0 ; egrep -i '^ *use ' $trufile > /dev/null 2>&1 && F90=1 187 192 egrep -i '^ *module ' $trufile > /dev/null 2>&1 && F90=1 188 193 egrep -i '#include*.inc ' $trufile > /dev/null 2>&1 && F90=1 189 str1='$(LIBO)/lib'$diri'.a('$fili'.o) : $(LIBF)/'$ diri/$trufile194 str1='$(LIBO)/lib'$diri'.a('$fili'.o) : $(LIBF)/'$trufile 190 195 [ "$fili" = "chem.subs" ] && str1=$str1' $(LIBF)/'$diri/chem.mods.F 191 for stri in ` ( sed -n "/\#include/s/\#include//p" $trufile | sed 's/\"//g' ; egrep -i '^ *use ' $trufile | sed -e 's/,/ /' | awk ' { print $2 } ' ) ` 192 do 193 194 196 197 ########################################################################## 198 # TRAITEMENT DES DEPENDANCES 195 199 # Differents cas de dependance correspondant a des include ou des 196 200 # use module. 197 201 # soit dans le repertoire local soit dans un autre. 198 199 stri=`echo $stri | tr [A-Z] [a-z]` 200 if [ -f $stri ] ; then 202 # Pour dyn3d, il faudrait remplacer la chaine de caractere par $DYN 203 # ou quelque chose du genre. 204 ########################################################################## 205 206 for stri in ` ( sed -e '/^[cC\!]/d' $trufile | sed -n "/\#include/s/\#include//p" | sed 's/\"//g' ; sed -e '/^[cC\!]/d' $trufile | egrep -i '^ *use ' | sed -e 's/,/ /' | awk ' { print $2 } ' ) ` 207 do 208 echo $trufile $fili $stri >> create_make_gcm.log 209 strj=`echo $stri | tr [A-Z] [a-z]` 210 str2="" 211 for dirinc in filtrez bibio grid dyn3d $diri $diri/*/ ; do 212 # Recherche dans l'ordre hierarchique inverse car seule la derniere 213 # ligne est conservee 214 if [ -f $dirinc/$stri ] ; then 215 str2='$(LIBF)/'$dirinc/$stri 216 elif [ -f $dirinc/$strj ] ; then 217 str2='$(LIBF)/'$dirinc/$stri 218 elif [ -f $dirinc/$strj.F90 ] || [ -f $dirinc/$strj.F ] ; then 219 strlib=`echo $dirinc | awk -F/ ' { print $1 } '` 220 str2='$(LIBO)/lib'$strlib'.a('$strj'.o)' 221 fi 222 done 223 if [ "$str2" = "" ] ; then 224 echo Warn: Include $diri $trufile $fili $stri pas trouve >> $gcm/create_make_gcm.log 225 elif [ "$str2" = "$str1" ] ; then 226 echo Warn: Include $diri $trufile $fili $stri $str1 trouve 2x >> $gcm/create_make_gcm.log 227 else 201 228 echo $str1 \\ 202 str1='$(LIBF)/'$diri'/'$stri 203 else 204 if [ -f $stri.F ] || [ -f $stri.F90 ] ; then 205 echo $str1 \\ 206 str1='$(LIBO)/lib'$diri'.a('$stri'.o)' 207 else 208 for dirinc in dyn3d grid bibio filtrez 209 do 210 if [ -f ../$dirinc/$stri ] ; then 211 echo $str1 \\ 212 str1='$(LIBF)/'`cd .. ; ls */$stri | head -1` 213 fi 214 if [ -f ../$dirinc/$stri.F90 ] ; then 215 echo $str1 \\ 216 str1='$(LIBO)/lib'$dirinc'.a('$stri'.o)' 217 fi 218 done 219 fi 229 str1=$str2 220 230 fi 221 done 231 done # Fin de la boucle sur les dependances et ecriture de la derniere 222 232 echo $str1 223 233 # Compile in LIBO directory; and before compiling, remove … … 227 237 if [ "$F90" -eq '0' ] ; then 228 238 ## Fixed Form Fortran 77 229 echo ' $(COMPILE) $(LIBF)/'$ diri'/'$trufile' ; \'239 echo ' $(COMPILE) $(LIBF)/'$trufile' ; \' 230 240 else 231 241 ## Fortran 90 232 242 if [ -f $fili.F90 ] ; then 233 243 ## Free Form 234 echo ' $(COMPTRU90) $(LIBF)/'$ diri'/'$trufile' ; \'244 echo ' $(COMPTRU90) $(LIBF)/'$trufile' ; \' 235 245 else 236 echo ' $(COMPILE90) $(LIBF)/'$ diri'/'$trufile' ; \'246 echo ' $(COMPILE90) $(LIBF)/'$trufile' ; \' 237 247 fi 238 248 fi -
trunk/LMDZ.COMMON/libf/dyn3d/comconst.h
r887 r979 29 29 REAL g ! (m/s2) gravity 30 30 REAL omeg ! (rad/s) rotation rate of the planet 31 ! Dissipation factors, for Earth model: 32 REAL dissip_factz,dissip_zref !dissip_deltaz 33 ! Dissipation factors, for other planets: 31 34 REAL dissip_fac_mid,dissip_fac_up,dissip_deltaz,dissip_hdelta 32 35 REAL dissip_pupstart -
trunk/LMDZ.COMMON/libf/dyn3d/comdissnew.h
r1 r979 12 12 13 13 COMMON/comdissnew/ lstardis,nitergdiv,nitergrot,niterh,tetagdiv, & 14 & tetagrot,tetatemp,coefdis 14 & tetagrot,tetatemp,coefdis, vert_prof_dissip 15 15 16 16 LOGICAL lstardis 17 17 INTEGER nitergdiv, nitergrot, niterh 18 19 ! For the Earth model: 20 integer vert_prof_dissip ! vertical profile of horizontal dissipation 21 ! Allowed values: 22 ! 0: rational fraction, function of pressure 23 ! 1: tanh of altitude 24 18 25 REAL tetagdiv, tetagrot, tetatemp, coefdis 19 26 -
trunk/LMDZ.COMMON/libf/dyn3d/conf_gcm.F
r617 r979 14 14 #endif 15 15 USE infotrac, ONLY : type_trac 16 use assert_m, only: assert 17 16 18 IMPLICIT NONE 17 19 c----------------------------------------------------------------------- … … 88 90 CALL getin('lunout', lunout) 89 91 IF (lunout /= 5 .and. lunout /= 6) THEN 90 OPEN(lunout,FILE='lmdz.out') 92 OPEN(UNIT=lunout,FILE='lmdz.out',ACTION='write', 93 & STATUS='unknown',FORM='formatted') 91 94 ENDIF 92 95 … … 311 314 CALL getin('tetatemp',tetatemp ) 312 315 316 ! For Earth model only: 317 ! Parametres controlant la variation sur la verticale des constantes de 318 ! dissipation. 319 ! Pour le moment actifs uniquement dans la version a 39 niveaux 320 ! avec ok_strato=y 321 322 dissip_factz=4. 323 dissip_deltaz=10. 324 dissip_zref=30. 325 CALL getin('dissip_factz',dissip_factz ) 326 CALL getin('dissip_deltaz',dissip_deltaz ) 327 CALL getin('dissip_zref',dissip_zref ) 328 329 ! For other planets: 313 330 ! Parametres controlant la variation sur la verticale des constantes de 314 331 ! dissipation. … … 474 491 write(lunout,*)'STOP !!!' 475 492 write(lunout,*)'use_filtre_fft n est pas implemente dans dyn3d' 476 STOP 493 STOP 1 477 494 ENDIF 478 495 … … 484 501 ok_strato=.TRUE. 485 502 CALL getin('ok_strato',ok_strato) 503 504 ! NB: vert_prof_dissip is Earth-specific; should not impact other models 505 if (planet_type=="earth") then 506 vert_prof_dissip = merge(1, 0, ok_strato .and. llm==39) 507 CALL getin('vert_prof_dissip', vert_prof_dissip) 508 call assert(vert_prof_dissip == 0 .or. vert_prof_dissip == 1, 509 $ "bad value for vert_prof_dissip") 510 else 511 vert_prof_dissip=0 512 endif 486 513 487 514 !Config Key = ok_gradsfile … … 834 861 write(lunout,*)' day_step = ', day_step 835 862 write(lunout,*)' iperiod = ', iperiod 863 write(lunout,*)' nsplit_phys = ', nsplit_phys 836 864 write(lunout,*)' iconser = ', iconser 837 865 write(lunout,*)' iecri = ', iecri -
trunk/LMDZ.COMMON/libf/dyn3d/gcm.F
r965 r979 428 428 429 429 CALL inidissip( lstardis, nitergdiv, nitergrot, niterh , 430 * tetagdiv, tetagrot , tetatemp 430 * tetagdiv, tetagrot , tetatemp, vert_prof_dissip) 431 431 432 432 c----------------------------------------------------------------------- -
trunk/LMDZ.COMMON/libf/dyn3d/guide_mod.F90
r776 r979 12 12 USE Write_Field 13 13 use netcdf, only: nf90_nowrite, nf90_open, nf90_inq_varid, nf90_close 14 use pres2lev_mod 14 15 15 16 IMPLICIT NONE -
trunk/LMDZ.COMMON/libf/dyn3d/inidissip.F90
r776 r979 3 3 ! 4 4 SUBROUTINE inidissip ( lstardis,nitergdiv,nitergrot,niterh , & 5 tetagdiv,tetagrot,tetatemp 5 tetagdiv,tetagrot,tetatemp, vert_prof_dissip) 6 6 !======================================================================= 7 7 ! initialisation de la dissipation horizontale … … 11 11 ! ------------- 12 12 13 USE control_mod, only : dissip_period,iperiod 13 USE control_mod, only : dissip_period,iperiod,planet_type 14 14 15 15 IMPLICIT NONE … … 26 26 REAL,INTENT(in) :: tetagdiv,tetagrot,tetatemp 27 27 28 integer, INTENT(in):: vert_prof_dissip ! for the Earth model !! 29 ! Vertical profile of horizontal dissipation 30 ! Allowed values: 31 ! 0: rational fraction, function of pressure 32 ! 1: tanh of altitude 33 28 34 ! Local variables: 29 35 REAL fact,zvert(llm),zz … … 35 41 INTEGER l,ij,idum,ii 36 42 REAL tetamin 43 REAL pseudoz 37 44 REAL Pup 38 45 character (len=80) :: abort_message … … 166 173 ! variation verticale du coefficient de dissipation: 167 174 ! -------------------------------------------------- 168 175 176 if (planet_type.eq."earth") then 177 178 if (vert_prof_dissip == 1) then 179 do l=1,llm 180 pseudoz=8.*log(preff/presnivs(l)) 181 zvert(l)=1+ & 182 (tanh((pseudoz-dissip_zref)/dissip_deltaz)+1.)/2. & 183 *(dissip_factz-1.) 184 enddo 185 else 186 DO l=1,llm 187 zvert(l)=1. 188 ENDDO 189 fact=2. 190 DO l = 1, llm 191 zz = 1. - preff/presnivs(l) 192 zvert(l)= fact -( fact-1.)/( 1.+zz*zz ) 193 ENDDO 194 endif ! of if (vert_prof_dissip == 1) 195 196 else ! other planets 197 169 198 ! First step: going from 1 to dissip_fac_mid (in gcm.def) 170 199 !============ 171 DO l=1,llm200 DO l=1,llm 172 201 zz = 1. - preff/presnivs(l) 173 202 zvert(l)= dissip_fac_mid -( dissip_fac_mid-1.)/( 1.+zz*zz ) 174 ENDDO175 176 write(lunout,*) 'Dissipation : '177 write(lunout,*) 'Multiplication de la dissipation en altitude :'178 write(lunout,*) ' dissip_fac_mid =', dissip_fac_mid203 ENDDO 204 205 write(lunout,*) 'Dissipation : ' 206 write(lunout,*) 'Multiplication de la dissipation en altitude :' 207 write(lunout,*) ' dissip_fac_mid =', dissip_fac_mid 179 208 180 209 ! Second step if ok_strato: from dissip_fac_mid to dissip_fac_up (in gcm.def) … … 188 217 ! atmosphere par celui-ci. 189 218 190 if (ok_strato) then219 if (ok_strato) then 191 220 192 221 Pup = dissip_pupstart*exp(-0.5*dissip_deltaz/dissip_hdelta) … … 201 230 dissip_pupstart,'Pa', dissip_deltaz , '(km)' 202 231 203 endif 232 endif ! of if (ok_strato) 233 234 endif ! of if (planet_type.eq."earth") 204 235 205 236 -
trunk/LMDZ.COMMON/libf/dyn3dpar/abort_gcm.F
r66 r979 1 1 ! 2 ! $Id: abort_gcm.F 1 475 2011-01-21 14:41:03Z emillour $2 ! $Id: abort_gcm.F 1748 2013-04-24 14:18:40Z emillour $ 3 3 ! 4 4 c … … 24 24 25 25 character(len=*) modname 26 integer ierr 26 integer ierr, ierror_mpi 27 27 character(len=*) message 28 28 … … 47 47 else 48 48 write(lunout,*) 'Houston, we have a problem ', ierr 49 #ifdef CPP_MPI 50 C$OMP CRITICAL (MPI_ABORT_GCM) 51 call MPI_ABORT(COMM_LMDZ, 1, ierror_mpi) 52 C$OMP END CRITICAL (MPI_ABORT_GCM) 53 #else 49 54 stop 1 55 #endif 50 56 endif 51 57 END -
trunk/LMDZ.COMMON/libf/dyn3dpar/comconst.h
r887 r979 29 29 REAL g ! (m/s2) gravity 30 30 REAL omeg ! (rad/s) rotation rate of the planet 31 ! Dissipation factors, for Earth model: 32 REAL dissip_factz,dissip_zref !dissip_deltaz 33 ! Dissipation factors, for other planets: 31 34 REAL dissip_fac_mid,dissip_fac_up,dissip_deltaz,dissip_hdelta 32 35 REAL dissip_pupstart -
trunk/LMDZ.COMMON/libf/dyn3dpar/comdissnew.h
r1 r979 12 12 13 13 COMMON/comdissnew/ lstardis,nitergdiv,nitergrot,niterh,tetagdiv, & 14 & tetagrot,tetatemp,coefdis 14 & tetagrot,tetatemp,coefdis, vert_prof_dissip 15 15 16 16 LOGICAL lstardis 17 17 INTEGER nitergdiv, nitergrot, niterh 18 19 ! For the Earth model: 20 integer vert_prof_dissip ! vertical profile of horizontal dissipation 21 ! Allowed values: 22 ! 0: rational fraction, function of pressure 23 ! 1: tanh of altitude 24 18 25 REAL tetagdiv, tetagrot, tetatemp, coefdis 19 26 -
trunk/LMDZ.COMMON/libf/dyn3dpar/conf_gcm.F
r617 r979 18 18 USE control_mod 19 19 USE infotrac, ONLY : type_trac 20 use assert_m, only: assert 20 21 IMPLICIT NONE 21 22 c----------------------------------------------------------------------- … … 54 55 LOGICAL fxyhypbb, ysinuss 55 56 INTEGER i 56 57 character(len=*),parameter :: modname="conf_gcm" 58 character (len=80) :: abort_message 59 #ifdef CPP_OMP 60 integer,external :: OMP_GET_NUM_THREADS 61 #endif 57 62 c 58 63 c ------------------------------------------------------------------- … … 83 88 c initialisations: 84 89 c ---------------- 85 adjust=.false. 86 call getin('adjust',adjust) 87 88 itaumax=0 89 call getin('itaumax',itaumax); 90 if (itaumax<=0) itaumax=HUGE(itaumax) 91 90 92 91 !Config Key = lunout 93 92 !Config Desc = unite de fichier pour les impressions … … 103 102 ENDIF 104 103 104 adjust=.false. 105 call getin('adjust',adjust) 106 107 #ifdef CPP_OMP 108 ! adjust=y not implemented in case of OpenMP threads... 109 !$OMP PARALLEL 110 if ((OMP_GET_NUM_THREADS()>1).and.adjust) then 111 write(lunout,*)'conf_gcm: Error, adjust should be set to n' 112 &,' when running with OpenMP threads' 113 abort_message = 'Wrong value for adjust' 114 call abort_gcm(modname,abort_message,1) 115 endif 116 !$OMP END PARALLEL 117 #endif 118 119 itaumax=0 120 call getin('itaumax',itaumax); 121 if (itaumax<=0) itaumax=HUGE(itaumax) 122 105 123 !Config Key = prt_level 106 124 !Config Desc = niveau d'impressions de débogage … … 323 341 CALL getin('tetatemp',tetatemp ) 324 342 343 ! For Earth model only: 344 ! Parametres controlant la variation sur la verticale des constantes de 345 ! dissipation. 346 ! Pour le moment actifs uniquement dans la version a 39 niveaux 347 ! avec ok_strato=y 348 349 dissip_factz=4. 350 dissip_deltaz=10. 351 dissip_zref=30. 352 CALL getin('dissip_factz',dissip_factz ) 353 CALL getin('dissip_deltaz',dissip_deltaz ) 354 CALL getin('dissip_zref',dissip_zref ) 355 356 ! For other planets: 325 357 ! Parametres controlant la variation sur la verticale des constantes de 326 358 ! dissipation. … … 494 526 write(lunout,*)"Le zoom en longitude est incompatible", 495 527 & " avec l'utilisation du filtre FFT ", 496 & "---> filtre FFT désactivé"528 & "---> FFT filter not active" 497 529 use_filtre_fft=.FALSE. 498 530 ENDIF … … 525 557 ok_strato=.TRUE. 526 558 CALL getin('ok_strato',ok_strato) 559 560 ! NB: vert_prof_dissip is Earth-specific; should not impact other models 561 if (planet_type=="earth") then 562 vert_prof_dissip = merge(1, 0, ok_strato .and. llm==39) 563 CALL getin('vert_prof_dissip', vert_prof_dissip) 564 call assert(vert_prof_dissip == 0 .or. vert_prof_dissip == 1, 565 $ "bad value for vert_prof_dissip") 566 else 567 vert_prof_dissip=0 568 endif 527 569 528 570 !Config Key = ok_gradsfile … … 875 917 write(lunout,*)' day_step = ', day_step 876 918 write(lunout,*)' iperiod = ', iperiod 919 write(lunout,*)' nsplit_phys = ', nsplit_phys 877 920 write(lunout,*)' iconser = ', iconser 878 921 write(lunout,*)' iecri = ', iecri -
trunk/LMDZ.COMMON/libf/dyn3dpar/gcm.F
r965 r979 443 443 444 444 CALL inidissip( lstardis, nitergdiv, nitergrot, niterh , 445 * tetagdiv, tetagrot , tetatemp 445 * tetagdiv, tetagrot , tetatemp, vert_prof_dissip) 446 446 447 447 c----------------------------------------------------------------------- -
trunk/LMDZ.COMMON/libf/dyn3dpar/guide_p_mod.F90
r776 r979 11 11 USE getparam 12 12 USE Write_Field_p 13 use netcdf, only: nf90_nowrite, nf90_open, nf90_inq_varid, nf90_close 13 USE netcdf, ONLY: nf90_nowrite, nf90_open, nf90_inq_varid, nf90_close 14 USE pres2lev_mod 14 15 15 16 IMPLICIT NONE -
trunk/LMDZ.COMMON/libf/dyn3dpar/inidissip.F90
r776 r979 3 3 ! 4 4 SUBROUTINE inidissip ( lstardis,nitergdiv,nitergrot,niterh , & 5 tetagdiv,tetagrot,tetatemp 5 tetagdiv,tetagrot,tetatemp, vert_prof_dissip) 6 6 !======================================================================= 7 7 ! initialisation de la dissipation horizontale … … 11 11 ! ------------- 12 12 13 USE control_mod, only : dissip_period,iperiod 13 USE control_mod, only : dissip_period,iperiod,planet_type 14 14 15 15 IMPLICIT NONE … … 26 26 REAL,INTENT(in) :: tetagdiv,tetagrot,tetatemp 27 27 28 integer, INTENT(in):: vert_prof_dissip ! for the Earth model !! 29 ! Vertical profile of horizontal dissipation 30 ! Allowed values: 31 ! 0: rational fraction, function of pressure 32 ! 1: tanh of altitude 33 28 34 ! Local variables: 29 35 REAL fact,zvert(llm),zz … … 35 41 INTEGER l,ij,idum,ii 36 42 REAL tetamin 43 REAL pseudoz 37 44 REAL Pup 38 45 character (len=80) :: abort_message … … 166 173 ! variation verticale du coefficient de dissipation: 167 174 ! -------------------------------------------------- 168 175 176 if (planet_type.eq."earth") then 177 178 if (vert_prof_dissip == 1) then 179 do l=1,llm 180 pseudoz=8.*log(preff/presnivs(l)) 181 zvert(l)=1+ & 182 (tanh((pseudoz-dissip_zref)/dissip_deltaz)+1.)/2. & 183 *(dissip_factz-1.) 184 enddo 185 else 186 DO l=1,llm 187 zvert(l)=1. 188 ENDDO 189 fact=2. 190 DO l = 1, llm 191 zz = 1. - preff/presnivs(l) 192 zvert(l)= fact -( fact-1.)/( 1.+zz*zz ) 193 ENDDO 194 endif ! of if (vert_prof_dissip == 1) 195 196 else ! other planets 197 169 198 ! First step: going from 1 to dissip_fac_mid (in gcm.def) 170 199 !============ 171 DO l=1,llm200 DO l=1,llm 172 201 zz = 1. - preff/presnivs(l) 173 202 zvert(l)= dissip_fac_mid -( dissip_fac_mid-1.)/( 1.+zz*zz ) 174 ENDDO175 176 write(lunout,*) 'Dissipation : '177 write(lunout,*) 'Multiplication de la dissipation en altitude :'178 write(lunout,*) ' dissip_fac_mid =', dissip_fac_mid203 ENDDO 204 205 write(lunout,*) 'Dissipation : ' 206 write(lunout,*) 'Multiplication de la dissipation en altitude :' 207 write(lunout,*) ' dissip_fac_mid =', dissip_fac_mid 179 208 180 209 ! Second step if ok_strato: from dissip_fac_mid to dissip_fac_up (in gcm.def) … … 188 217 ! atmosphere par celui-ci. 189 218 190 if (ok_strato) then219 if (ok_strato) then 191 220 192 221 Pup = dissip_pupstart*exp(-0.5*dissip_deltaz/dissip_hdelta) … … 201 230 dissip_pupstart,'Pa', dissip_deltaz , '(km)' 202 231 203 endif 232 endif ! of if (ok_strato) 233 234 endif ! of if (planet_type.eq."earth") 204 235 205 236 -
trunk/LMDZ.COMMON/libf/filtrez/filtreg.F
r1 r979 185 185 DO j = jdfil,jffil 186 186 #ifdef BLAS 187 CALL DGEMM("N", "N", iim, nbniv, iim, 1.0,187 CALL SGEMM("N", "N", iim, nbniv, iim, 1.0, 188 188 & matrinvn(1,1,j), 189 189 & iim, champ(1,j,1), iip1*nlat, 0.0, … … 199 199 DO j = jdfil,jffil 200 200 #ifdef BLAS 201 CALL DGEMM("N", "N", iim, nbniv, iim, 1.0,201 CALL SGEMM("N", "N", iim, nbniv, iim, 1.0, 202 202 & matriceun(1,1,j), 203 203 & iim, champ(1,j,1), iip1*nlat, 0.0, … … 213 213 DO j = jdfil,jffil 214 214 #ifdef BLAS 215 CALL DGEMM("N", "N", iim, nbniv, iim, 1.0,215 CALL SGEMM("N", "N", iim, nbniv, iim, 1.0, 216 216 & matricevn(1,1,j), 217 217 & iim, champ(1,j,1), iip1*nlat, 0.0, … … 231 231 DO j = jdfil,jffil 232 232 #ifdef BLAS 233 CALL DGEMM("N", "N", iim, nbniv, iim, 1.0,233 CALL SGEMM("N", "N", iim, nbniv, iim, 1.0, 234 234 & matrinvs(1,1,j-jfiltsu+1), 235 235 & iim, champ(1,j,1), iip1*nlat, 0.0, … … 247 247 DO j = jdfil,jffil 248 248 #ifdef BLAS 249 CALL DGEMM("N", "N", iim, nbniv, iim, 1.0,249 CALL SGEMM("N", "N", iim, nbniv, iim, 1.0, 250 250 & matriceus(1,1,j-jfiltsu+1), 251 251 & iim, champ(1,j,1), iip1*nlat, 0.0, … … 262 262 DO j = jdfil,jffil 263 263 #ifdef BLAS 264 CALL DGEMM("N", "N", iim, nbniv, iim, 1.0,264 CALL SGEMM("N", "N", iim, nbniv, iim, 1.0, 265 265 & matricevs(1,1,j-jfiltsv+1), 266 266 & iim, champ(1,j,1), iip1*nlat, 0.0, -
trunk/LMDZ.COMMON/libf/filtrez/filtreg_mod.F90
r492 r979 10 10 11 11 SUBROUTINE inifilr 12 USE mod_filtre_fft 13 !12 USE mod_filtre_fft, ONLY : use_filtre_fft,Init_filtre_fft 13 USE mod_filtre_fft_loc, ONLY : Init_filtre_fft_loc=>Init_filtre_fft ! 14 14 ! ... H. Upadhyaya, O.Sharma ... 15 15 ! … … 541 541 CALL Init_filtre_fft(coefilu,modfrstu,jfiltnu,jfiltsu, & 542 542 coefilv,modfrstv,jfiltnv,jfiltsv) 543 CALL Init_filtre_fft_loc(coefilu,modfrstu,jfiltnu,jfiltsu, & 544 coefilv,modfrstv,jfiltnv,jfiltsv) 543 545 ENDIF 544 546 -
trunk/LMDZ.COMMON/libf/filtrez/mod_fft.F90
r1 r979 3 3 #ifdef FFT_MATHKEISAN 4 4 USE mod_fft_mathkeisan 5 #elif FFT_FFTW 5 #else 6 #ifdef FFT_FFTW 6 7 USE mod_fft_fftw 7 #elif FFT_MKL 8 #else 9 #ifdef FFT_MKL 8 10 USE mod_fft_mkl 9 11 #else 10 12 USE mod_fft_wrapper 11 13 #endif 14 #endif 15 #endif 12 16 13 17 END MODULE mod_fft -
trunk/LMDZ.COMMON/makelmdz
r957 r979 19 19 chimie=false 20 20 parallel=none 21 paramem="par" 21 22 compil_mod=prod 22 23 io=ioipsl … … 29 30 30 31 # guess a default 'arch' 31 arch=" g95" # start with assuming we're on a Linux/Unix machine with g9532 arch="local" # start with assuming we're on a local machine with local arch file 32 33 ## try to recognise machine and infer arch from it 33 34 machine=`hostname` … … 126 127 [-cpp CPP_KEY] : additional preprocessing definitions 127 128 [-adjnt] : adjoint model, not operational ... 129 [-mem] : reduced memory dynamics (if in parallel mode) 128 130 [-filtre NOMFILTRE] : use filtre from libf/NOMFILTRE (default: filtrez) 129 131 [-link LINKS] : additional links with other libraries … … 138 140 139 141 "-p") 140 physique="$2" ; 142 physique="$2" ; shift ; shift ;; 141 143 142 144 "-s") … … 186 188 "-cosp") 187 189 cosp="$2" ; shift ; shift ;; 190 191 "-mem") 192 paramem="mem" ; shift ;; 188 193 189 194 "-filtre") … … 424 429 ######################################################################## 425 430 431 cd $LIBFGCM/grid 432 if [[ -f dimensions.h ]] 433 then 434 echo 'ATTENTION: vous etes sans doute en train de compiler le modele par ailleurs' 435 echo "Attendez que la premiere compilation soit terminee pour relancer la suivante." 436 echo "Si vous etes sur que vous ne compilez pas le modele par ailleurs," 437 echo vous pouvez continuer en repondant oui. 438 echo "Voulez-vous vraiment continuer?" 439 echo "" 440 echo "WARNING: you are probably already compiling the model somewhere else." 441 echo "Wait until the first compilation is finished before launching this one." 442 echo "If you are sure that you are not compiling elsewhere, just answer " 443 echo "yes (or 'oui') to the question below to proceed." 444 echo "Do you wish to continue?" 445 read reponse 446 if [[ $reponse == "oui" || $reponse == "yes" ]] 447 then 448 \rm -f $LIBFGCM/grid/dimensions.h 449 else 450 exit 451 fi 452 fi 453 454 426 455 cd $LIBFGCM/grid/dimension 427 456 ./makdim $dim … … 496 525 then 497 526 SUFF_NAME=${SUFF_NAME}_para 527 DYN=dyn${dimc}d${paramem} 528 if [[ "$paramem" == "mem" ]] 529 then 530 SUFF_NAME=${SUFF_NAME}_${paramem} 531 fi 498 532 else 499 533 SUFF_NAME=${SUFF_NAME}_seq 534 DYN=dyn${dimc}d 500 535 fi 501 536 … … 634 669 then 635 670 INCLUDE="$INCLUDE"' -I$(LIBF)/phy'"$physique" 671 phys="PHYS=$physique" 672 else 673 # trick to avoid having a physics-related library in the makefile 674 phys="L_PHY= LIBPHY=" 636 675 fi 637 676 if (( $dimension == 1 )) … … 674 713 $dyn \ 675 714 LIBO=${LIBOGCM}/${nomlib} \ 676 PHYS=$physique\715 $phys \ 677 716 DIM=$dimc \ 678 717 FLAG_PARA=$FLAG_PARA \ … … 705 744 $dyn \ 706 745 LIBO=${LIBOGCM}/${nomlib} \ 707 PHYS=$physique\746 $phys \ 708 747 DIM=$dimc \ 709 748 FLAG_PARA=$FLAG_PARA \ … … 725 764 PROG=$code 726 765 727 if [[ -r $ libf/grid/dimensions.h ]]766 if [[ -r $LIBFGCM/grid/dimensions.h ]] 728 767 then 729 768 # Cleanup: remove dimension.h file 730 \rm -f $ libf/grid/dimensions.h731 fi 769 \rm -f $LIBFGCM/grid/dimensions.h 770 fi -
trunk/LMDZ.COMMON/makelmdz_fcm
r957 r979 25 25 chemistry=false 26 26 parallel=none 27 paramem="par" 27 28 compil_mod=prod 28 29 io=ioipsl … … 80 81 [-cpp CPP_KEY] : additional preprocessing definitions 81 82 [-adjnt] : adjoint model, not operational ... 83 [-mem] : reduced memory dynamics (if in parallel mode) 82 84 [-filtre NOMFILTRE] : use filtre from libf/NOMFILTRE (default: filtrez) 83 85 [-link LINKS] : additional links with other libraries … … 142 144 cosp="$2" ; shift ; shift ;; 143 145 146 "-mem") 147 paramem="mem" ; shift ;; 144 148 145 149 "-filtre") … … 164 168 165 169 ############################################################### 166 # mettre le chemin du fcm dans le path170 # path to fcm 167 171 ############################################################### 172 # handle case when provided path to fcm was given as a relative 173 # path (from makelmdz_fcm script directory) and not an absolute path 174 if [[ ${fcm_path:0:1} != "/" ]] ; then 175 # prepend with makelmdz_fcm location 176 fcm_path=$(cd $(dirname $0) ; pwd)"/"${fcm_path} 177 fi 178 179 # add fcm_path to PATH 168 180 export PATH=${fcm_path}:${PATH} 169 181 170 echo " Chemin du fcm utlise :"171 which fcm 182 echo "Path to fcm:" 183 echo ${fcm_path} 172 184 173 185 ############################################################### … … 295 307 # on cree ou remplace le fichier des dimensions 296 308 ######################################################################## 309 310 cd $LIBFGCM/grid 311 if [[ -f dimensions.h ]] 312 then 313 echo 'ATTENTION: vous etes sans doute en train de compiler le modele par ailleurs' 314 echo "Attendez que la premiere compilation soit terminee pour relancer la suivante." 315 echo "Si vous etes sur que vous ne compilez pas le modele par ailleurs," 316 echo vous pouvez continuer en repondant oui. 317 echo "Voulez-vous vraiment continuer?" 318 echo "" 319 echo "WARNING: you are probably already compiling the model somewhere else." 320 echo "Wait until the first compilation is finished before launching this one." 321 echo "If you are sure that you are not compiling elsewhere, just answer " 322 echo "yes (or 'oui') to the question below to proceed." 323 echo "Do you wish to continue?" 324 read reponse 325 if [[ $reponse == "oui" || $reponse == "yes" ]] 326 then 327 \rm -f $LIBFGCM/grid/dimensions.h 328 else 329 exit 330 fi 331 fi 332 297 333 298 334 cd $LIBFGCM/grid/dimension … … 393 429 then 394 430 SUFF_NAME=${SUFF_NAME}_para 395 DYN=dyn${dimc}dpar 431 DYN=dyn${dimc}d${paramem} 432 if [[ "$paramem" == "mem" ]] 433 then 434 SUFF_NAME=${SUFF_NAME}_${paramem} 435 fi 396 436 else 397 437 SUFF_NAME=${SUFF_NAME}_seq … … 463 503 ln -s $LIBOGCM/${arch}${SUFF_NAME}/.config config 464 504 ln -s $LIBOGCM/${arch}${SUFF_NAME}/.config/tmp tmp_src 505 506 if [[ -r $LIBFGCM/grid/dimensions.h ]] 507 then 508 # Cleanup: remove dimension.h file 509 \rm -f $LIBFGCM/grid/dimensions.h 510 fi
Note: See TracChangeset
for help on using the changeset viewer.