Changeset 1707
- Timestamp:
- Jan 11, 2013, 10:19:19 AM (12 years ago)
- Location:
- LMDZ5/branches/testing
- Files:
-
- 26 deleted
- 101 edited
- 36 copied
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/branches/testing
- Property svn:mergeinfo changed
/LMDZ5/trunk merged: 1670-1692,1694-1703,1705-1706
- Property svn:mergeinfo changed
-
LMDZ5/branches/testing/DefLists/physiq.def_L39_AR40.0
r1481 r1707 99 99 #ok_kzmin : calcul Kzmin dans la CL de surface 100 100 ok_kzmin=y 101 #couplage ou non avec la convection 102 iflag_coupl=0 (0:AR4 et 1:nouvelle physique)101 #couplage ou non avec la convection (0:AR4 et 1:nouvelle physique) 102 iflag_coupl=0 103 103 seuil_inversion=-0.08 104 104 -
LMDZ5/branches/testing/arch/arch-CICLADifort.fcm
r1669 r1707 4 4 %MAKE make 5 5 %FPP_FLAGS -P -traditional 6 %FPP_DEF NC_DOUBLE BLAS SGEMV=DGEMV SGEMM=DGEMM FFT_FFTW6 %FPP_DEF NC_DOUBLE 7 7 %BASE_FFLAGS -real-size 64 -ip -mkl=parallel -fp-model precise -align common -mcmodel=large 8 8 %PROD_FFLAGS -O2 … … 12 12 %OMP_FFLAGS 13 13 %BASE_LD -mkl=parallel 14 %MPI_LD -L/usr/lib64/openmpi/1.4.3-ifort/lib -lmpi -lmkl_core -lfftw314 %MPI_LD -L/usr/lib64/openmpi/1.4.3-ifort/lib -lmpi -lmkl_core 15 15 %OMP_LD -
LMDZ5/branches/testing/create_make_gcm
r1492 r1707 96 96 echo ' cd $(LOCAL_DIR); \' 97 97 echo ' $(COMPILE90) $(LIBF)/$(DIRMAIN)/$(SOURCE) -o $(PROG).o ; \' 98 echo ' $(LINK) $(PROG).o -L$(LIBO) $(L_DYN) $(L_ADJNT) $(L_COSP) $(L_ FILTRE) $(L_PHY) $(L_DYN) $(L_BIBIO) $(L_DYN) $(OPLINK) $(OPTION_LINK) -o $(LOCAL_DIR)/$(PROG).e ; $(RM) $(PROG).o '98 echo ' $(LINK) $(PROG).o -L$(LIBO) $(L_DYN) $(L_ADJNT) $(L_COSP) $(L_PHY) $(L_DYN) $(L_BIBIO) $(L_DYN) $(L_FILTRE) $(OPLINK) $(OPTION_LINK) -o $(LOCAL_DIR)/$(PROG).e ; $(RM) $(PROG).o ' 99 99 echo 100 100 echo 'dyn : $(LIBO)/libdyn$(DIM)d$(FLAG_PARA).a $(FILTRE)$(DIM)d' … … 224 224 # Put generated object in library 225 225 echo ' $(AR) r $(LIBO)/lib'$diri'.a '$fili'.o ; $(RM) '$fili'.o ; \' 226 echo ' cd $(GCM)'227 226 echo 228 227 done -
LMDZ5/branches/testing/libf/dyn3d/calfis.F
r1669 r1707 507 507 . debut_split, !! firstcall 508 508 . lafin_split, !! lastcall 509 . float(day_ini), !! pday <-- day_ini (dans temps.h)509 . jD_cur, !! pday. see leapfrog 510 510 . jH_cur_split, !! ptime "fraction of day" 511 511 . zdt_split, !! ptimestep -
LMDZ5/branches/testing/libf/dyn3d/comconst.h
r1505 r1707 21 21 REAL dtdiss ! (s) time step for the dissipation 22 22 REAL rad ! (m) radius of the planet 23 REAL r ! Gas constant R=8.31 J.K-1.mol-1 24 REAL cpp ! Cp 23 REAL r ! Reduced Gas constant r=R/mu 24 ! with R=8.31.. J.K-1.mol-1, mu: mol mass of atmosphere (kg/mol) 25 REAL cpp ! Specific heat Cp (J.kg-1.K-1) 25 26 REAL kappa ! kappa=R/Cp 26 27 REAL cotot -
LMDZ5/branches/testing/libf/dyn3d/comdissnew.h
r1319 r1707 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 integer vert_prof_dissip ! vertical profile of horizontal dissipation 20 ! Allowed values: 21 ! 0: rational fraction, function of pressure 22 ! 1: tanh of altitude 23 18 24 REAL tetagdiv, tetagrot, tetatemp, coefdis 19 25 -
LMDZ5/branches/testing/libf/dyn3d/conf_gcm.F
r1665 r1707 14 14 #endif 15 15 USE infotrac, ONLY : type_trac 16 use assert_m, only: assert 17 16 18 IMPLICIT NONE 17 19 c----------------------------------------------------------------------- … … 93 95 CALL getin('lunout', lunout) 94 96 IF (lunout /= 5 .and. lunout /= 6) THEN 95 OPEN(lunout,FILE='lmdz.out') 97 OPEN(UNIT=lunout,FILE='lmdz.out',ACTION='write', 98 & STATUS='unknown',FORM='formatted') 96 99 ENDIF 97 100 … … 173 176 174 177 !Config Key = nsplit_phys 175 !Config Desc = nombre de pas par jour176 !Config Def = 1177 !Config Help = nombre de pas par jour (multiple de iperiod) (178 !Config ici pour dt = 1 min )179 178 nsplit_phys = 1 180 179 CALL getin('nsplit_phys',nsplit_phys) … … 625 624 CALL getin('ok_dyn_ave',ok_dyn_ave) 626 625 627 628 626 write(lunout,*)' #########################################' 629 627 write(lunout,*)' Configuration des parametres du gcm: ' … … 635 633 write(lunout,*)' day_step = ', day_step 636 634 write(lunout,*)' iperiod = ', iperiod 635 write(lunout,*)' nsplit_phys = ', nsplit_phys 637 636 write(lunout,*)' iconser = ', iconser 638 637 write(lunout,*)' iecri = ', iecri … … 805 804 !Config Desc = sortie des transports zonaux dans la dynamique 806 805 !Config Def = n 807 !Config Help = 806 !Config Help = Permet de mettre en route le calcul des transports 808 807 !Config 809 ok_dynzon = .FALSE.810 808 ok_dynzon = .FALSE. 809 CALL getin('ok_dynzon',ok_dynzon) 811 810 812 811 !Config Key = ok_dyn_ins … … 838 837 write(lunout,*)'STOP !!!' 839 838 write(lunout,*)'use_filtre_fft n est pas implemente dans dyn3d' 840 STOP 839 STOP 1 841 840 ENDIF 842 841 … … 848 847 ok_strato=.FALSE. 849 848 CALL getin('ok_strato',ok_strato) 849 850 vert_prof_dissip = merge(1, 0, ok_strato .and. llm==39) 851 CALL getin('vert_prof_dissip', vert_prof_dissip) 852 call assert(vert_prof_dissip == 0 .or. vert_prof_dissip == 1, 853 $ "bad value for vert_prof_dissip") 850 854 851 855 !Config Key = ok_gradsfile -
LMDZ5/branches/testing/libf/dyn3d/fxhyp.F
r1403 r1707 68 68 xzoom = xzoomdeg * pi/180. 69 69 c 70 if (iim==1) then 71 72 rlonm025(1)=-pi/2. 73 rlonv(1)=0. 74 rlonu(1)=pi 75 rlonp025(1)=pi/2. 76 rlonm025(2)=rlonm025(1)+depi 77 rlonv(2)=rlonv(1)+depi 78 rlonu(2)=rlonu(1)+depi 79 rlonp025(2)=rlonp025(1)+depi 80 81 xprimm025(:)=1. 82 xprimv(:)=1. 83 xprimu(:)=1. 84 xprimp025(:)=1. 85 champmin=depi 86 champmax=depi 87 return 88 89 endif 90 70 91 decalx = .75 71 92 IF( grossism.EQ.1..AND.scal180 ) THEN … … 286 307 287 308 309 288 310 IF(ik.EQ.1.and.grossism.EQ.1.) THEN 289 311 xvrai(1) = xvrai(iip1)-depi 290 312 xxprim(1) = xxprim(iip1) 291 313 ENDIF 314 292 315 DO i = 1 , iim 293 316 xlon(i) = xvrai(i) -
LMDZ5/branches/testing/libf/dyn3d/gcm.F
r1665 r1707 405 405 406 406 CALL inidissip( lstardis, nitergdiv, nitergrot, niterh , 407 * tetagdiv, tetagrot , tetatemp 407 * tetagdiv, tetagrot , tetatemp, vert_prof_dissip) 408 408 409 409 c----------------------------------------------------------------------- … … 433 433 ! Physics: 434 434 #ifdef CPP_PHYS 435 CALL iniphysiq(ngridmx,llm,daysec,day_ini,dtphys/nsplit_phys , 436 , latfi,lonfi,airefi,zcufi,zcvfi,rad,g,r,cpp ) 435 CALL iniphysiq(ngridmx,llm,daysec,day_ini,dtphys/nsplit_phys, 436 & latfi,lonfi,airefi,zcufi,zcvfi,rad,g,r,cpp, 437 & iflag_phys) 437 438 #endif 438 439 call_iniphys=.false. … … 457 458 301 FORMAT('1'/,15x,'run du ', i2,'/',i2,'/',i4) 458 459 302 FORMAT('1'/,15x,' au ', i2,'/',i2,'/',i4) 459 #endif460 461 #ifdef CPP_PHYS462 ! Create start file (startphy.nc) and boundary conditions (limit.nc)463 ! for the Earth verstion464 if (iflag_phys>=100) then465 call iniaqua(ngridmx,latfi,lonfi,iflag_phys)466 endif467 460 #endif 468 461 -
LMDZ5/branches/testing/libf/dyn3d/groupe.F
r524 r1707 38 38 integer i,j,l 39 39 40 logical firstcall 41 save firstcall 40 logical firstcall,groupe_ok 41 save firstcall,groupe_ok 42 42 43 43 data firstcall/.true./ 44 data groupe_ok/.true./ 45 46 if (iim==1) then 47 groupe_ok=.false. 48 endif 44 49 45 50 if (firstcall) then 46 if(mod(iim,2**ngroup).ne.0) stop'probleme du nombre ede point' 51 if (groupe_ok) then 52 if(mod(iim,2**ngroup).ne.0) stop'probleme du nombre de point' 53 endif 47 54 firstcall=.false. 48 55 endif 56 49 57 50 58 c Champs 1D … … 52 60 call convflu(pbaru,pbarv,llm,zconvm) 53 61 54 c55 62 call scopy(ijp1llm,zconvm,1,zconvmm,1) 56 63 call scopy(ijmllm,pbarv,1,pbarvm,1) 57 64 58 c 65 if (groupe_ok) then 59 66 call groupeun(jjp1,llm,zconvmm) 60 67 call groupeun(jjm,llm,pbarvm) 61 68 62 69 c Champs 3D 63 64 70 do l=1,llm 65 71 do j=2,jjm … … 74 80 enddo 75 81 enddo 82 83 else 84 pbarum(:,:,:)=pbaru(:,:,:) 85 pbarvm(:,:,:)=pbarv(:,:,:) 86 endif 76 87 77 88 c integration de la convergence de masse de haut en bas ...... -
LMDZ5/branches/testing/libf/dyn3d/inidissip.F90
r1665 r1707 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 … … 25 25 INTEGER,INTENT(in) :: nitergdiv,nitergrot,niterh 26 26 REAL,INTENT(in) :: tetagdiv,tetagrot,tetatemp 27 28 integer, INTENT(in):: vert_prof_dissip 29 ! Vertical profile of horizontal dissipation 30 ! Allowed values: 31 ! 0: rational fraction, function of pressure 32 ! 1: tanh of altitude 27 33 28 34 ! Local variables: … … 167 173 ! -------------------------------------------------- 168 174 169 if ( ok_strato .and. llm==39) then175 if (vert_prof_dissip == 1) then 170 176 do l=1,llm 171 177 pseudoz=8.*log(preff/presnivs(l)) -
LMDZ5/branches/testing/libf/dyn3d/leapfrog.F
r1669 r1707 383 383 jD_cur = jD_ref + day_ini - day_ref + & 384 384 & itau/day_step 385 386 IF (planet_type .eq."generic") THEN 387 ! AS: we make jD_cur to be pday 388 jD_cur = int(day_ini + itau/day_step) 389 ENDIF 390 385 391 jH_cur = jH_ref + start_time + & 386 392 & mod(itau,day_step)/float(day_step) -
LMDZ5/branches/testing/libf/dyn3d/paramet.h
r792 r1707 17 17 INTEGER jcfil,jcfllm 18 18 19 PARAMETER( iip1= iim+1 -1/iim,iip2=iim+2,iip3=iim+3&19 PARAMETER( iip1= iim+1,iip2=iim+2,iip3=iim+3 & 20 20 & ,jjp1=jjm+1-1/jjm) 21 21 PARAMETER( llmp1 = llm+1, llmp2 = llm+2, llmm1 = llm-1 ) -
LMDZ5/branches/testing/libf/dyn3dmem/abort_gcm.F
r1669 r1707 1 1 ! 2 ! $Id : abort_gcm.F 1425 2010-09-02 13:45:23Z lguez$2 ! $Id$ 3 3 ! 4 4 c … … 45 45 if (ierr .eq. 0) then 46 46 write(lunout,*) 'Everything is cool' 47 stop48 47 else 49 48 write(lunout,*) 'Houston, we have a problem ', ierr -
LMDZ5/branches/testing/libf/dyn3dmem/academic.h
r1669 r1707 1 1 ! 2 ! $ Header$2 ! $Id$ 3 3 ! 4 real tetarappel(ip1jmp1,llm),taurappel 5 common/academic/tetarappel,taurappel 4 common/academic/tetarappel,knewt_t,kfrict,knewt_g,clat4 5 real :: tetarappel(ip1jmp1,llm) 6 real :: knewt_t(llm) 7 real :: kfrict(llm) 8 real :: knewt_g 9 real :: clat4(ip1jmp1) -
LMDZ5/branches/testing/libf/dyn3dmem/addfi_loc.F
r1669 r1707 1 1 ! 2 ! $ Header$2 ! $Id$ 3 3 ! 4 4 SUBROUTINE addfi_loc(pdt, leapf, forward, … … 7 7 USE parallel 8 8 USE infotrac, ONLY : nqtot 9 USE control_mod, ONLY : planet_type 9 10 IMPLICIT NONE 10 11 c … … 156 157 c$OMP END MASTER 157 158 159 if (planet_type=="earth") then 160 ! earth case, special treatment for first 2 tracers (water) 158 161 DO iq = 1, 2 159 162 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) … … 177 180 c$OMP END DO NOWAIT 178 181 ENDDO 182 else 183 ! general case, treat all tracers equally) 184 DO iq = 1, nqtot 185 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 186 DO k = 1,llm 187 DO j = ijb,ije 188 pq(j,k,iq)= pq(j,k,iq) + pdqfi(j,k,iq) * pdt 189 pq(j,k,iq)= AMAX1( pq(j,k,iq), qtestt ) 190 ENDDO 191 ENDDO 192 c$OMP END DO NOWAIT 193 ENDDO 194 endif ! of if (planet_type=="earth") 179 195 180 196 c$OMP MASTER -
LMDZ5/branches/testing/libf/dyn3dmem/advtrac_loc.F
r1669 r1707 1 1 ! 2 ! $Id : advtrac_p.F 1299 2010-01-20 14:27:21Z fairhead$2 ! $Id$ 3 3 ! 4 4 c … … 342 342 c$OMP BARRIER 343 343 344 if (planet_type=="earth") then 345 344 346 ijb=ij_begin 345 347 ije=ij_end … … 355 357 CALL qminimum_loc( q, 2, finmasse ) 356 358 359 endif ! of if (planet_type=="earth") 357 360 358 361 RETURN -
LMDZ5/branches/testing/libf/dyn3dmem/bands.F90
r1669 r1707 1 1 ! 2 ! $Id : bands.F90 1279 2009-12-10 09:02:56Z fairhead$2 ! $Id$ 3 3 ! 4 4 module Bands … … 105 105 SUBROUTINE Set_Bands 106 106 USE parallel 107 #ifdef CPP_ EARTH108 ! Ehouarn: what follows is only related to // physics ; for now only for Earth107 #ifdef CPP_PHYS 108 ! Ehouarn: what follows is only related to // physics 109 109 USE mod_phys_lmdz_para, ONLY : jj_para_begin,jj_para_end 110 110 #endif … … 118 118 enddo 119 119 120 #ifdef CPP_EARTH 121 ! Ehouarn: what follows is only related to // physics; for now only for Earth 120 #ifdef CPP_PHYS 122 121 do i=0,MPI_Size-1 123 122 jj_Nb_physic(i)=jj_para_end(i)-jj_para_begin(i)+1 … … 374 373 subroutine AdjustBands_physic 375 374 use times 376 #ifdef CPP_ EARTH377 ! Ehouarn: what follows is only related to // physics ; for now only for Earth375 #ifdef CPP_PHYS 376 ! Ehouarn: what follows is only related to // physics 378 377 USE mod_phys_lmdz_para, only : klon_mpi_para_nb 379 378 #endif … … 401 400 medium=medium/mpi_size 402 401 NbTot=0 403 #ifdef CPP_EARTH 404 ! Ehouarn: what follows is only related to // physics; for now only for Earth 402 #ifdef CPP_PHYS 405 403 do i=0,mpi_size-1 406 404 Inc(i)=nint(klon_mpi_para_nb(i)*(medium-value(i))/value(i)) -
LMDZ5/branches/testing/libf/dyn3dmem/bilan_dyn_loc.F
r1669 r1707 421 421 Q_cum(:,jjb:jje,:,l)=0. 422 422 flux_uQ_cum(:,jjb:jje,l,:)=0. 423 flux_v_cum(:,jjb:jje,l)=0.424 423 if (pole_sud) jje=jj_end-1 425 424 flux_v_cum(:,jjb:jje,l)=0. -
LMDZ5/branches/testing/libf/dyn3dmem/caladvtrac_loc.F
r1669 r1707 8 8 * flxw, pk, iapptrac) 9 9 USE parallel 10 USE infotrac 11 USE control_mod 10 USE infotrac, ONLY : nqtot 11 USE control_mod, ONLY : iapp_tracvl,planet_type 12 12 USE caladvtrac_mod 13 13 USE mod_hallo … … 38 38 REAL :: masse(ijb_u:ije_u,llm) 39 39 REAL :: p( ijb_u:ije_u,llmp1) 40 REAL :: q( ijb_u:ije_u,llm,nqtot),dq( ijb_u:ije_u,llm, 2)40 REAL :: q( ijb_u:ije_u,llm,nqtot),dq( ijb_u:ije_u,llm, nqtot ) 41 41 REAL :: teta( ijb_u:ije_u,llm),pk( ijb_u:ije_u,llm) 42 42 REAL :: flxw(ijb_u:ije_u,llm) -
LMDZ5/branches/testing/libf/dyn3dmem/calfis_loc.F
r1669 r1707 27 27 $ pdqfi, 28 28 $ pdpsfi) 29 #ifdef CPP_ EARTH30 ! Ehouarn: For now, calfis_p needs Earthphysics29 #ifdef CPP_PHYS 30 ! If using physics 31 31 c 32 32 c Auteur : P. Le Van, F. Hourdin … … 36 36 USE parallel, ONLY : omp_chunk, using_mpi,jjb_u,jje_u,jjb_v,jje_v 37 37 USE mod_interface_dyn_phys 38 USE IOPHY 39 #endif 38 40 USE Write_Field 39 41 Use Write_field_p 40 42 USE Times 41 USE IOPHY42 43 USE infotrac 43 44 USE control_mod … … 145 146 146 147 148 #ifdef CPP_PHYS 149 ! Ehouarn: for now calfis_p needs some informations from physics to compile 147 150 c Local variables : 148 151 c ----------------- … … 220 223 PARAMETER(ntetaSTD=3) 221 224 REAL rtetaSTD(ntetaSTD) 222 DATA rtetaSTD/350., 380., 405./ 225 DATA rtetaSTD/350., 380., 405./ ! Earth-specific values, beware !! 223 226 REAL PVteta(klon,ntetaSTD) 224 227 … … 243 246 REAL,ALLOCATABLE,SAVE:: zdufi2(:,:),zdvfi2(:,:) 244 247 integer :: k,kstart,kend 245 INTEGER :: offset 248 INTEGER :: offset 249 250 LOGICAL tracerdyn 246 251 c 247 252 c----------------------------------------------------------------------- … … 512 517 513 518 514 IF (is_sequential) THEN 515 c 519 IF (is_sequential.and.(planet_type=="earth")) THEN 520 #ifdef CPP_PHYS 521 ! PVtheta calls tetalevel, which is in the physics 516 522 cIM calcul PV a teta=350, 380, 405K 517 523 CALL PVtheta(ngridmx,llm,pucov,pvcov,pteta, … … 519 525 $ ntetaSTD,rtetaSTD,PVteta) 520 526 c 527 #endif 521 528 ENDIF 522 529 … … 662 669 c$OMP BARRIER 663 670 664 if (planet_type=="earth") then665 #ifdef CPP_EARTH666 667 671 668 672 !$OMP MASTER … … 675 679 zdqfic_omp(:,:,:)=0. 676 680 681 #ifdef CPP_PHYS 677 682 do isplit=1,nsplit_phys 678 683 … … 681 686 lafin_split=lafin.and.isplit==nsplit_phys 682 687 688 if (planet_type=="earth") then 683 689 684 690 CALL physiq (klon, … … 711 717 . PVteta) 712 718 719 else if ( planet_type=="generic" ) then 720 721 CALL physiq (klon, !! ngrid 722 . llm, !! nlayer 723 . nqtot, !! nq 724 . tname, !! tracer names from dynamical core (given in infotrac) 725 . debut_split, !! firstcall 726 . lafin_split, !! lastcall 727 . jD_cur, !! pday. see leapfrog_p 728 . jH_cur_split, !! ptime "fraction of day" 729 . zdt_split, !! ptimestep 730 . zplev_omp, !! pplev 731 . zplay_omp, !! pplay 732 . zphi_omp, !! pphi 733 . zufi_omp, !! pu 734 . zvfi_omp, !! pv 735 . ztfi_omp, !! pt 736 . zqfi_omp, !! pq 737 . flxwfi_omp, !! pw !! or 0. anyway this is for diagnostic. not used in physiq. 738 . zdufi_omp, !! pdu 739 . zdvfi_omp, !! pdv 740 . zdtfi_omp, !! pdt 741 . zdqfi_omp, !! pdq 742 . zdpsrf_omp, !! pdpsrf 743 . tracerdyn) !! tracerdyn <-- utilite ??? 744 745 endif ! of if (planet_type=="earth") 746 747 713 748 zufi_omp(:,:)=zufi_omp(:,:)+zdufi_omp(:,:)*zdt_split 714 749 zvfi_omp(:,:)=zvfi_omp(:,:)+zdvfi_omp(:,:)*zdt_split … … 723 758 enddo 724 759 760 #endif 761 ! of #ifdef CPP_PHYS 762 763 725 764 zdufi_omp(:,:)=zdufic_omp(:,:)/nsplit_phys 726 765 zdvfi_omp(:,:)=zdvfic_omp(:,:)/nsplit_phys … … 728 767 zdqfi_omp(:,:,:)=zdqfic_omp(:,:,:)/nsplit_phys 729 768 730 #endif731 endif !of if (planet_type=="earth")732 769 c$OMP BARRIER 733 770 … … 1179 1216 firstcal = .FALSE. 1180 1217 1181 #else 1182 write(*,*) "calfis_p: for now can only work with parallel physics" 1183 write(lunout,*) 1184 & "calfis_p: for now can only work with parallel physics" 1185 stop 1186 #endif 1187 ! of #ifdef CPP_EARTH 1218 #else 1219 write(lunout,*) 1220 & "calfis_p: for now can only work with parallel physics" 1221 stop 1222 #endif 1223 ! of #ifdef CPP_PHYS 1188 1224 RETURN 1189 1225 END -
LMDZ5/branches/testing/libf/dyn3dmem/call_calfis_mod.F90
r1669 r1707 136 136 !$OMP END MASTER 137 137 138 jD_cur = jD_ref + day_ini - day_ref + int (itau * dtvr / daysec) 139 jH_cur = jH_ref + (itau * dtvr / daysec - int(itau * dtvr / daysec)) 138 jD_cur = jD_ref + day_ini - day_ref & 139 & + itau/day_step 140 141 IF (planet_type .eq."generic") THEN 142 ! AS: we make jD_cur to be pday 143 jD_cur = int(day_ini + itau/day_step) 144 ENDIF 145 146 jH_cur = jH_ref + start_time + & 147 & mod(itau,day_step)/float(day_step) 148 if (jH_cur > 1.0 ) then 149 jD_cur = jD_cur +1. 150 jH_cur = jH_cur -1. 151 endif 140 152 141 153 ! Inbterface avec les routines de phylmd (phymars ... ) -
LMDZ5/branches/testing/libf/dyn3dmem/call_dissip_mod.F90
r1669 r1707 240 240 !$OMP END DO NOWAIT 241 241 242 if (1 == 0) then 243 !!! Ehouarn: lines here 1) kill 1+1=2 in the dynamics 244 !!! 2) should probably not be here anyway 245 !!! but are kept for those who would want to revert to previous behaviour 242 246 !$OMP MASTER 243 247 DO ij = 1,iim … … 251 255 !$OMP END MASTER 252 256 253 ENDIF 257 ENDIF ! of if (1 == 0) 258 endif ! of of (pole_nord) 254 259 255 260 IF (pole_sud) THEN … … 269 274 !$OMP END DO NOWAIT 270 275 276 if (1 == 0) then 277 !!! Ehouarn: lines here 1) kill 1+1=2 in the dynamics 278 !!! 2) should probably not be here anyway 279 !!! but are kept for those who would want to revert to previous behaviour 271 280 !$OMP MASTER 272 281 DO ij = 1,iim … … 279 288 ENDDO 280 289 !$OMP END MASTER 281 ENDIF 290 ENDIF ! of if (1 == 0) 291 endif ! of if (pole_sud) 282 292 283 293 -
LMDZ5/branches/testing/libf/dyn3dmem/ce0l.F90
r1669 r1707 1 1 ! 2 ! $Id : ce0l.F90 1425 2010-09-02 13:45:23Z lguez$2 ! $Id$ 3 3 ! 4 4 !------------------------------------------------------------------------------- … … 19 19 USE dimphy 20 20 USE comgeomphy 21 USE mod_phys_lmdz_para 21 USE mod_phys_lmdz_para, mpi_root_xx=>mpi_root 22 22 USE mod_const_mpi 23 23 USE infotrac 24 USE parallel, ONLY: finalize_parallel 24 25 25 26 #ifdef CPP_IOIPSL … … 30 31 IMPLICIT NONE 31 32 #ifndef CPP_EARTH 33 #include "iniprint.h" 32 34 WRITE(lunout,*)'limit_netcdf: Earth-specific routine, needs Earth physics' 33 35 #else … … 41 43 #include "temps.h" 42 44 #include "logic.h" 45 #ifdef CPP_MPI 46 include 'mpif.h' 47 #endif 48 43 49 INTEGER, PARAMETER :: longcles=20 50 INTEGER :: ierr 44 51 REAL, DIMENSION(longcles) :: clesphy0 45 52 REAL, DIMENSION(iip1,jjp1) :: masque 46 53 CHARACTER(LEN=15) :: calnd 54 REAL, DIMENSION(iip1,jjp1) :: phis ! geopotentiel au sol 47 55 !------------------------------------------------------------------------------- 48 56 CALL conf_gcm( 99, .TRUE. , clesphy0 ) 49 57 58 #ifdef CPP_MPI 50 59 CALL init_mpi 60 #endif 51 61 52 62 CALL Init_Phys_lmdz(iim,jjp1,llm,1,(/(jjm-1)*iim+2/)) … … 55 65 CALL abort_gcm('ce0l','In parallel mode, & 56 66 & ce0l must be called only & 57 & for 1 process and 1 task' )67 & for 1 process and 1 task',1) 58 68 ENDIF 59 69 … … 76 86 #endif 77 87 78 IF ( config_inca /= 'none') THEN88 IF (type_trac == 'inca') THEN 79 89 #ifdef INCA 80 CALL init_const_lmdz(nbtr,anneeref,dayref,iphysiq,day_step,nday) 81 CALL init_inca_para(iim,jjm+1,klon,1,klon_mpi_para_nb,0) 82 WRITE(lunout,*)'nbtr =' , nbtr 90 CALL init_const_lmdz( & 91 nbtr,anneeref,dayref,& 92 iphysiq,day_step,nday,& 93 nbsrf, is_oce,is_sic,& 94 is_ter,is_lic) 95 83 96 #endif 84 97 END IF … … 90 103 WRITE(lunout,'(//)') 91 104 WRITE(lunout,*) ' interbar = ',interbar 92 CALL etat0_netcdf(interbar,masque, ok_etat0)105 CALL etat0_netcdf(interbar,masque,phis,ok_etat0) 93 106 94 107 IF(ok_limit) THEN … … 101 114 END IF 102 115 116 IF (grilles_gcm_netcdf) THEN 117 WRITE(lunout,'(//)') 118 WRITE(lunout,*) ' *************************** ' 119 WRITE(lunout,*) ' *** grilles_gcm_netcdf *** ' 120 WRITE(lunout,*) ' *************************** ' 121 WRITE(lunout,'(//)') 122 CALL grilles_gcm_netcdf_sub(masque,phis) 123 END IF 124 125 #ifdef CPP_MPI 126 !$OMP MASTER 127 CALL MPI_FINALIZE(ierr) 128 IF (ierr /= 0) CALL abort_gcm('ce0l','Error in MPI_FINALIZE',1) 129 !$OMP END MASTER 130 #endif 131 103 132 #endif 104 133 ! of #ifndef CPP_EARTH #else -
LMDZ5/branches/testing/libf/dyn3dmem/comconst.h
r1669 r1707 1 1 ! 2 ! $Id : comconst.h 1279 2009-12-10 09:02:56Z fairhead$2 ! $Id$ 3 3 ! 4 4 !----------------------------------------------------------------------- 5 5 ! INCLUDE comconst.h 6 6 7 COMMON/comconst/im,jm,lllm,imp1,jmp1,lllmm1,lllmp1,lcl, & 8 & dtvr,daysec, & 7 COMMON/comconsti/im,jm,lllm,imp1,jmp1,lllmm1,lllmp1,lcl, & 8 & iflag_top_bound 9 COMMON/comconstr/dtvr,daysec, & 9 10 & pi,dtphys,dtdiss,rad,r,cpp,kappa,cotot,unsim,g,omeg & 10 11 & ,dissip_factz,dissip_deltaz,dissip_zref & 11 & ,iflag_top_bound,tau_top_bound 12 & ,tau_top_bound, & 13 & daylen,year_day,molmass, ihf 12 14 13 15 14 16 INTEGER im,jm,lllm,imp1,jmp1,lllmm1,lllmp1,lcl 15 REAL dtvr,daysec 16 REAL pi,dtphys,dtdiss,rad,r,cpp,kappa 17 REAL cotot,unsim,g,omeg 17 REAL dtvr ! dynamical time step (in s) 18 REAL daysec !length (in s) of a standard day 19 REAL pi ! something like 3.14159.... 20 REAL dtphys ! (s) time step for the physics 21 REAL dtdiss ! (s) time step for the dissipation 22 REAL rad ! (m) radius of the planet 23 REAL r ! Reduced Gas constant r=R/mu 24 ! with R=8.31.. J.K-1.mol-1, mu: mol mass of atmosphere (kg/mol) 25 REAL cpp ! Specific heat Cp (J.kg-1.K-1) 26 REAL kappa ! kappa=R/Cp 27 REAL cotot 28 REAL unsim ! = 1./iim 29 REAL g ! (m/s2) gravity 30 REAL omeg ! (rad/s) rotation rate of the planet 18 31 REAL dissip_factz,dissip_deltaz,dissip_zref 19 32 INTEGER iflag_top_bound 20 33 REAL tau_top_bound 34 REAL daylen ! length of solar day, in 'standard' day length 35 REAL year_day ! Number of standard days in a year 36 REAL molmass ! (g/mol) molar mass of the atmosphere 21 37 38 REAL ihf ! (W/m2) Intrinsic heat flux (for giant planets) 22 39 23 40 !----------------------------------------------------------------------- -
LMDZ5/branches/testing/libf/dyn3dmem/comdissipn.h
r1669 r1707 1 1 ! 2 ! $ Header$2 ! $Id$ 3 3 ! 4 c----------------------------------------------------------------------- 5 c INCLUDE comdissipn.h 4 ! Attention : ce fichier include est compatible format fixe/format libre 5 ! veillez à n'utiliser que des ! pour les commentaires 6 ! et à bien positionner les & des lignes de continuation 7 ! (les placer en colonne 6 et en colonne 73) 8 !----------------------------------------------------------------------- 9 ! INCLUDE comdissipn.h 6 10 7 11 REAL tetaudiv, tetaurot, tetah, cdivu, crot, cdivh 8 c 9 COMMON/comdissipn/ tetaudiv(llm),tetaurot(llm),tetah(llm) , 10 1cdivu, crot, cdivh12 ! 13 COMMON/comdissipn/ tetaudiv(llm),tetaurot(llm),tetah(llm) , & 14 & cdivu, crot, cdivh 11 15 12 c 13 cLes parametres de ce common proviennent des calculs effectues dans14 cInidissip .15 c 16 c-----------------------------------------------------------------------16 ! 17 ! Les parametres de ce common proviennent des calculs effectues dans 18 ! Inidissip . 19 ! 20 !----------------------------------------------------------------------- -
LMDZ5/branches/testing/libf/dyn3dmem/comdissnew.h
r1669 r1707 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 integer vert_prof_dissip ! vertical profile of horizontal dissipation 20 ! Allowed values: 21 ! 0: rational fraction, function of pressure 22 ! 1: tanh of altitude 23 18 24 REAL tetagdiv, tetagrot, tetatemp, coefdis 19 25 -
LMDZ5/branches/testing/libf/dyn3dmem/comvert.h
r1669 r1707 1 1 ! 2 ! $ Header$2 ! $Id$ 3 3 ! 4 4 !----------------------------------------------------------------------- 5 5 ! INCLUDE 'comvert.h' 6 6 7 COMMON/comvert/ap(llm+1),bp(llm+1),presnivs(llm),dpres(llm), & 8 & pa,preff,nivsigs(llm),nivsig(llm+1) 7 COMMON/comvertr/ap(llm+1),bp(llm+1),presnivs(llm),dpres(llm), & 8 & pa,preff,nivsigs(llm),nivsig(llm+1), & 9 & aps(llm),bps(llm),scaleheight,pseudoalt(llm) 9 10 10 common/comverti/disvert_type 11 common/comverti/disvert_type, pressure_exner 11 12 12 REAL ap,bp,presnivs,dpres,pa,preff,nivsigs,nivsig 13 real ap ! hybrid pressure contribution at interlayers 14 real bp ! hybrid sigma contribution at interlayer 15 real presnivs ! (reference) pressure at mid-layers 16 real dpres 17 real pa ! reference pressure (Pa) at which hybrid coordinates 18 ! become purely pressure 19 real preff ! reference surface pressure (Pa) 20 real nivsigs 21 real nivsig 22 real aps ! hybrid pressure contribution at mid-layers 23 real bps ! hybrid sigma contribution at mid-layers 24 real scaleheight ! atmospheric (reference) scale height (km) 25 real pseudoalt ! for planets 13 26 14 27 integer disvert_type ! type of vertical discretization: … … 17 30 ! 2: Planets (default for planet_type!=earth), 18 31 ! using 'z2sig.def' (or 'esasig.def) file 19 !----------------------------------------------------------------------- 32 33 logical pressure_exner 34 ! compute pressure inside layers using Exner function, else use mean 35 ! of pressure values at interfaces 36 37 !----------------------------------------------------------------------- -
LMDZ5/branches/testing/libf/dyn3dmem/conf_gcm.F
r1669 r1707 1 1 ! 2 ! $Id : conf_gcm.F 1403 2010-07-01 09:02:53Z fairhead$2 ! $Id$ 3 3 ! 4 4 c … … 6 6 SUBROUTINE conf_gcm( tapedef, etatinit, clesphy0 ) 7 7 c 8 USE control_mod 8 9 #ifdef CPP_IOIPSL 9 10 use IOIPSL … … 17 18 use mod_hallo, ONLY : use_mpi_alloc 18 19 use parallel, ONLY : omp_chunk 19 USE control_mod 20 USE infotrac, ONLY : type_trac 21 use assert_m, only: assert 22 20 23 IMPLICIT NONE 21 24 c----------------------------------------------------------------------- … … 43 46 #include "serre.h" 44 47 #include "comdissnew.h" 45 !#include "clesphys.h"46 #include "iniprint.h"47 48 #include "temps.h" 48 49 #include "comconst.h" 49 50 50 51 ! FH 2008/05/09 On elimine toutes les clefs physiques dans la dynamique 52 ! #include "clesphys.h" 53 #include "iniprint.h" 51 54 c 52 55 c … … 103 106 CALL getin('lunout', lunout) 104 107 IF (lunout /= 5 .and. lunout /= 6) THEN 105 OPEN(lunout,FILE='lmdz.out') 108 OPEN(UNIT=lunout,FILE='lmdz.out_0000',ACTION='write', 109 & STATUS='unknown',FORM='formatted') 106 110 ENDIF 107 111 … … 166 170 CALL getin('nday',nday) 167 171 172 !Config Key = starttime 173 !Config Desc = Heure de depart de la simulation 174 !Config Def = 0 175 !Config Help = Heure de depart de la simulation 176 !Config en jour 177 starttime = 0 178 CALL getin('starttime',starttime) 179 168 180 !Config Key = day_step 169 181 !Config Desc = nombre de pas par jour … … 175 187 176 188 !Config Key = nsplit_phys 177 !Config Desc = nombre d'iteration de la physique178 !Config Def = 240179 !Config Help = nombre d'itration de la physique180 !181 189 nsplit_phys = 1 182 190 CALL getin('nsplit_phys',nsplit_phys) … … 226 234 CALL getin('output_grads_dyn',output_grads_dyn) 227 235 228 !Config Key = idissip236 !Config Key = dissip_period 229 237 !Config Desc = periode de la dissipation 230 !Config Def = 10238 !Config Def = 0 231 239 !Config Help = periode de la dissipation 232 !Config (en pas) ... a completer ! 233 idissip = 10 234 CALL getin('idissip',idissip) 240 !Config dissip_period=0 => la valeur sera calcule dans inidissip 241 !Config dissip_period>0 => on prend cette valeur 242 dissip_period = 0 243 CALL getin('dissip_period',dissip_period) 235 244 236 245 ccc .... P. Le Van , modif le 29/04/97 .pour la dissipation ... … … 314 323 CALL getin('tau_top_bound',tau_top_bound) 315 324 316 !317 325 !Config Key = coefdis 318 326 !Config Desc = coefficient pour gamdissip … … 579 587 offline = .FALSE. 580 588 CALL getin('offline',offline) 589 IF (offline .AND. adjust) THEN 590 WRITE(lunout,*) 591 & 'WARNING : option offline does not work with adjust=y :' 592 WRITE(lunout,*) 'the files defstoke.nc, fluxstoke.nc ', 593 & 'and fluxstokev.nc will not be created' 594 WRITE(lunout,*) 595 & 'only the file phystoke.nc will still be created ' 596 END IF 597 598 !Config Key = type_trac 599 !Config Desc = Choix de couplage avec model de chimie INCA ou REPROBUS 600 !Config Def = lmdz 601 !Config Help = 602 !Config 'lmdz' = pas de couplage, pur LMDZ 603 !Config 'inca' = model de chime INCA 604 !Config 'repr' = model de chime REPROBUS 605 type_trac = 'lmdz' 606 CALL getin('type_trac',type_trac) 581 607 582 608 !Config Key = config_inca … … 628 654 write(lunout,*)' periodav = ', periodav 629 655 write(lunout,*)' output_grads_dyn = ', output_grads_dyn 630 write(lunout,*)' idissip = ', idissip656 write(lunout,*)' dissip_period = ', dissip_period 631 657 write(lunout,*)' lstardis = ', lstardis 632 658 write(lunout,*)' nitergdiv = ', nitergdiv … … 651 677 write(lunout,*)' tauyy = ', tauyy 652 678 write(lunout,*)' offline = ', offline 679 write(lunout,*)' type_trac = ', type_trac 653 680 write(lunout,*)' config_inca = ', config_inca 654 681 write(lunout,*)' ok_dynzon = ', ok_dynzon … … 769 796 offline = .FALSE. 770 797 CALL getin('offline',offline) 798 IF (offline .AND. adjust) THEN 799 WRITE(lunout,*) 800 & 'WARNING : option offline does not work with adjust=y :' 801 WRITE(lunout,*) 'the files defstoke.nc, fluxstoke.nc ', 802 & 'and fluxstokev.nc will not be created' 803 WRITE(lunout,*) 804 & 'only the file phystoke.nc will still be created ' 805 END IF 806 807 !Config Key = type_trac 808 !Config Desc = Choix de couplage avec model de chimie INCA ou REPROBUS 809 !Config Def = lmdz 810 !Config Help = 811 !Config 'lmdz' = pas de couplage, pur LMDZ 812 !Config 'inca' = model de chime INCA 813 !Config 'repr' = model de chime REPROBUS 814 type_trac = 'lmdz' 815 CALL getin('type_trac',type_trac) 771 816 772 817 !Config Key = config_inca … … 781 826 782 827 !Config Key = ok_dynzon 783 !Config Desc = calcul et sortie des transports828 !Config Desc = sortie des transports zonaux dans la dynamique 784 829 !Config Def = n 785 830 !Config Help = Permet de mettre en route le calcul des transports … … 817 862 write(lunout,*)"Le zoom en longitude est incompatible", 818 863 & " avec l'utilisation du filtre FFT ", 819 & "---> filtre FFT désactivé"864 & "---> FFT filter not active" 820 865 use_filtre_fft=.FALSE. 821 866 ENDIF … … 851 896 CALL getin('ok_strato',ok_strato) 852 897 898 vert_prof_dissip = merge(1, 0, ok_strato .and. llm==39) 899 CALL getin('vert_prof_dissip', vert_prof_dissip) 900 call assert(vert_prof_dissip == 0 .or. vert_prof_dissip == 1, 901 $ "bad value for vert_prof_dissip") 902 853 903 !Config Key = ok_gradsfile 854 904 !Config Desc = activation des sorties grads du guidage … … 874 924 ok_etat0 = .TRUE. 875 925 CALL getin('ok_etat0',ok_etat0) 926 927 !Config Key = grilles_gcm_netcdf 928 !Config Desc = creation de fichier grilles_gcm.nc dans create_etat0_limit 929 !Config Def = n 930 grilles_gcm_netcdf = .FALSE. 931 CALL getin('grilles_gcm_netcdf',grilles_gcm_netcdf) 876 932 877 933 write(lunout,*)' #########################################' … … 889 945 write(lunout,*)' periodav = ', periodav 890 946 write(lunout,*)' output_grads_dyn = ', output_grads_dyn 891 write(lunout,*)' idissip = ', idissip947 write(lunout,*)' dissip_period = ', dissip_period 892 948 write(lunout,*)' lstardis = ', lstardis 893 949 write(lunout,*)' nitergdiv = ', nitergdiv … … 912 968 write(lunout,*)' tauy = ', tauy 913 969 write(lunout,*)' offline = ', offline 970 write(lunout,*)' type_trac = ', type_trac 914 971 write(lunout,*)' config_inca = ', config_inca 915 write(lunout,*)' ok_dynzon = ', ok_dynzon 972 write(lunout,*)' ok_dynzon = ', ok_dynzon 916 973 write(lunout,*)' ok_dyn_ins = ', ok_dyn_ins 917 974 write(lunout,*)' ok_dyn_ave = ', ok_dyn_ave … … 923 980 write(lunout,*)' ok_limit = ', ok_limit 924 981 write(lunout,*)' ok_etat0 = ', ok_etat0 982 write(lunout,*)' grilles_gcm_netcdf = ', grilles_gcm_netcdf 925 983 c 926 984 RETURN -
LMDZ5/branches/testing/libf/dyn3dmem/control_mod.F90
r1669 r1707 10 10 IMPLICIT NONE 11 11 12 REAL :: periodav 12 REAL :: periodav, starttime 13 13 INTEGER :: nday,day_step,iperiod,iapp_tracvl,nsplit_phys 14 INTEGER :: iconser,iecri, idissip,iphysiq,iecrimoy14 INTEGER :: iconser,iecri,dissip_period,iphysiq,iecrimoy 15 15 INTEGER :: dayref,anneeref, raz_date, ip_ebil_dyn 16 16 LOGICAL :: offline … … 25 25 ! in NetCDF files dyn_hist*ave.nc 26 26 27 LOGICAL ok_dynzon ! output zonal transports in dynzon.nc file28 LOGICAL ok_dyn_ins ! output instantaneous values of fields29 ! in the dynamics in NetCDF files dyn_hist*nc30 LOGICAL ok_dyn_ave ! output averaged values of fields in the dynamics31 ! in NetCDF files dyn_hist*ave.nc32 33 27 END MODULE -
LMDZ5/branches/testing/libf/dyn3dmem/defrun.F
r1669 r1707 1 1 ! 2 ! $Id : defrun.F 1403 2010-07-01 09:02:53Z fairhead$2 ! $Id$ 3 3 ! 4 4 c … … 132 132 133 133 READ (tapedef,9001) ch1,ch4 134 READ (tapedef,*) idissip135 WRITE(tapeout,9001) ch1,' idissip'136 WRITE(tapeout,*) idissip134 READ (tapedef,*) dissip_period 135 WRITE(tapeout,9001) ch1,'dissip_period' 136 WRITE(tapeout,*) dissip_period 137 137 138 138 ccc .... P. Le Van , modif le 29/04/97 .pour la dissipation ... -
LMDZ5/branches/testing/libf/dyn3dmem/dynetat0_loc.F
r1669 r1707 5 5 . teta,q,masse,ps,phis,time) 6 6 USE infotrac 7 use control_mod, only : planet_type 7 8 USE parallel 8 9 IMPLICIT NONE … … 57 58 REAL,ALLOCATABLE :: phis_glo(:) 58 59 60 INTEGER idecal 61 59 62 c----------------------------------------------------------------------- 60 63 c Ouverture NetCDF du fichier etat initial … … 84 87 ENDIF 85 88 89 !!! AS: idecal is a hack to be able to read planeto starts... 90 !!! .... while keeping everything OK for LMDZ EARTH 91 if (planet_type.eq."generic") then 92 print*,'NOTE NOTE NOTE : Planeto-like start files' 93 idecal = 4 94 annee_ref = 2000 95 else 96 print*,'NOTE NOTE NOTE : Earth-like start files' 97 idecal = 5 98 annee_ref = tab_cntrl(5) 99 endif 100 101 86 102 im = tab_cntrl(1) 87 103 jm = tab_cntrl(2) 88 104 lllm = tab_cntrl(3) 89 105 day_ref = tab_cntrl(4) 90 annee_ref = tab_cntrl(5) 91 rad = tab_cntrl(6) 92 omeg = tab_cntrl(7) 93 g = tab_cntrl(8) 94 cpp = tab_cntrl(9) 95 kappa = tab_cntrl(10) 96 daysec = tab_cntrl(11) 97 dtvr = tab_cntrl(12) 98 etot0 = tab_cntrl(13) 99 ptot0 = tab_cntrl(14) 100 ztot0 = tab_cntrl(15) 101 stot0 = tab_cntrl(16) 102 ang0 = tab_cntrl(17) 103 pa = tab_cntrl(18) 104 preff = tab_cntrl(19) 105 c 106 clon = tab_cntrl(20) 107 clat = tab_cntrl(21) 108 grossismx = tab_cntrl(22) 109 grossismy = tab_cntrl(23) 110 c 111 IF ( tab_cntrl(24).EQ.1. ) THEN 106 rad = tab_cntrl(idecal+1) 107 omeg = tab_cntrl(idecal+2) 108 g = tab_cntrl(idecal+3) 109 cpp = tab_cntrl(idecal+4) 110 kappa = tab_cntrl(idecal+5) 111 daysec = tab_cntrl(idecal+6) 112 dtvr = tab_cntrl(idecal+7) 113 etot0 = tab_cntrl(idecal+8) 114 ptot0 = tab_cntrl(idecal+9) 115 ztot0 = tab_cntrl(idecal+10) 116 stot0 = tab_cntrl(idecal+11) 117 ang0 = tab_cntrl(idecal+12) 118 pa = tab_cntrl(idecal+13) 119 preff = tab_cntrl(idecal+14) 120 c 121 clon = tab_cntrl(idecal+15) 122 clat = tab_cntrl(idecal+16) 123 grossismx = tab_cntrl(idecal+17) 124 grossismy = tab_cntrl(idecal+18) 125 c 126 IF ( tab_cntrl(idecal+19).EQ.1. ) THEN 112 127 fxyhypb = . TRUE . 113 128 c dzoomx = tab_cntrl(25) … … 118 133 fxyhypb = . FALSE . 119 134 ysinus = . FALSE . 120 IF( tab_cntrl( 27).EQ.1. ) ysinus = . TRUE.135 IF( tab_cntrl(idecal+22).EQ.1. ) ysinus = . TRUE. 121 136 ENDIF 122 137 … … 266 281 ierr = NF_INQ_VARID (nid, "temps", nvarid) 267 282 IF (ierr .NE. NF_NOERR) THEN 268 write(lunout,*)"dynetat0_loc: Le champ <temps> est absent" 269 CALL abort 283 write(lunout,*)"dynetat0: Le champ <temps> est absent" 284 write(lunout,*)"dynetat0: J essaie <Time>" 285 ierr = NF_INQ_VARID (nid, "Time", nvarid) 286 IF (ierr .NE. NF_NOERR) THEN 287 write(lunout,*)"dynetat0: Le champ <Time> est absent" 288 CALL abort 289 ENDIF 270 290 ENDIF 271 291 #ifdef NC_DOUBLE -
LMDZ5/branches/testing/libf/dyn3dmem/dynredem_loc.F
r1669 r1707 1 1 ! 2 ! $Id : dynredem_p.F 1299 2010-01-20 14:27:21Z fairhead$2 ! $Id$ 3 3 ! 4 4 c … … 126 126 tab_cntrl(30) = REAL(iday_end) 127 127 tab_cntrl(31) = REAL(itau_dyn + itaufin) 128 c start_time: start_time of simulation (not necessarily 0.) 129 tab_cntrl(32) = start_time 128 130 c 129 131 c ......................................................... … … 635 637 CALL dynredem_write_u(nid,"ps",ps,1) 636 638 637 IF ( config_inca == 'none') THEN639 IF (type_trac /= 'inca') THEN 638 640 DO iq=1,nqtot 639 641 CALL dynredem_write_u(nid,tname(iq),q(:,:,iq),llm) -
LMDZ5/branches/testing/libf/dyn3dmem/dynredem_mod.F90
r1669 r1707 1 ! 2 ! $Id$ 3 ! 1 4 MODULE dynredem_mod 2 3 4 5 6 5 7 6 CONTAINS … … 37 36 ENDIF 38 37 !$OMP END MASTER 39 40 ll=size(var,2)41 38 42 39 !$OMP MASTER … … 105 102 !$OMP END MASTER 106 103 107 ll=size(var,2)108 109 104 !$OMP MASTER 110 105 ALLOCATE(var_tmp(ijb_v:ije_v,ll)) … … 172 167 !$OMP END MASTER 173 168 174 ll=size(var,2)175 176 169 !$OMP MASTER 177 170 ALLOCATE(var_tmp(ijb_u:ije_u,ll)) -
LMDZ5/branches/testing/libf/dyn3dmem/ener.h
r1669 r1707 1 1 ! 2 ! $ Header$2 ! $Id$ 3 3 ! 4 !----------------------------------------------------------------------- 4 ! ATTENTION!!!!: ce fichier include est compatible format fixe/format libre 5 ! veillez à n'utiliser que des ! pour les commentaires 6 ! et à bien positionner les & des lignes de continuation 7 ! (les placer en colonne 6 et en colonne 73) 8 ! 5 9 ! INCLUDE 'ener.h' 6 10 7 COMMON/ener/ang0,etot0,ptot0,ztot0,stot0, 8 & ang,etot,ptot,ztot,stot,rmsdpdt , 11 COMMON/ener/ang0,etot0,ptot0,ztot0,stot0, & 12 & ang,etot,ptot,ztot,stot,rmsdpdt , & 9 13 & rmsv,gtot(llmm1) 10 11 REAL ang0,etot0,ptot0,ztot0,stot0, & 14 REAL ang0,etot0,ptot0,ztot0,stot0, & 12 15 & ang,etot,ptot,ztot,stot,rmsdpdt,rmsv,gtot 13 16 -
LMDZ5/branches/testing/libf/dyn3dmem/exner_hyb.F
r1669 r1707 1 1 ! 2 ! $Id : exner_hyb.F 1403 2010-07-01 09:02:53Z fairhead$2 ! $Id$ 3 3 ! 4 4 SUBROUTINE exner_hyb ( ngrid, ps, p,alpha,beta, pks, pk, pkf ) … … 51 51 REAL SSUM 52 52 c 53 logical,save :: firstcall=.true. 54 character(len=*),parameter :: modname="exner_hyb" 55 56 ! Sanity check 57 if (firstcall) then 58 ! sanity checks for Shallow Water case (1 vertical layer) 59 if (llm.eq.1) then 60 if (kappa.ne.1) then 61 call abort_gcm(modname, 62 & "kappa!=1 , but running in Shallow Water mode!!",42) 63 endif 64 if (cpp.ne.r) then 65 call abort_gcm(modname, 66 & "cpp!=r , but running in Shallow Water mode!!",42) 67 endif 68 endif ! of if (llm.eq.1) 69 70 firstcall=.false. 71 endif ! of if (firstcall) 53 72 54 73 if (llm.eq.1) then 55 ! Specific behaviour for Shallow Water (1 vertical layer) case56 57 ! Sanity checks58 if (kappa.ne.1) then59 call abort_gcm("exner_hyb",60 & "kappa!=1 , but running in Shallow Water mode!!",42)61 endif62 if (cpp.ne.r) then63 call abort_gcm("exner_hyb",64 & "cpp!=r , but running in Shallow Water mode!!",42)65 endif66 74 67 75 ! Compute pks(:),pk(:),pkf(:) … … 77 85 ! our work is done, exit routine 78 86 return 87 79 88 endif ! of if (llm.eq.1) 80 89 90 !!!! General case: 81 91 82 92 unpl2k = 1.+ 2.* kappa -
LMDZ5/branches/testing/libf/dyn3dmem/exner_hyb_loc.F
r1669 r1707 57 57 EXTERNAL SSUM 58 58 INTEGER ije,ijb,jje,jjb 59 logical,save :: firstcall=.true. 60 !$OMP THREADPRIVATE(firstcall) 61 character(len=*),parameter :: modname="exner_hyb_loc" 59 62 c 60 63 c$OMP BARRIER 61 64 65 ! Sanity check 66 if (firstcall) then 67 ! sanity checks for Shallow Water case (1 vertical layer) 68 if (llm.eq.1) then 69 if (kappa.ne.1) then 70 call abort_gcm(modname, 71 & "kappa!=1 , but running in Shallow Water mode!!",42) 72 endif 73 if (cpp.ne.r) then 74 call abort_gcm(modname, 75 & "cpp!=r , but running in Shallow Water mode!!",42) 76 endif 77 endif ! of if (llm.eq.1) 78 79 firstcall=.false. 80 endif ! of if (firstcall) 81 82 c$OMP BARRIER 83 84 ! Specific behaviour for Shallow Water (1 vertical layer) case 62 85 if (llm.eq.1) then 63 ! Specific behaviour for Shallow Water (1 vertical layer) case64 65 ! Sanity checks66 if (kappa.ne.1) then67 call abort_gcm("exner_hyb",68 & "kappa!=1 , but running in Shallow Water mode!!",42)69 endif70 if (cpp.ne.r) then71 call abort_gcm("exner_hyb",72 & "cpp!=r , but running in Shallow Water mode!!",42)73 endif74 86 75 87 ! Compute pks(:),pk(:),pkf(:) … … 111 123 endif 112 124 !$OMP END MASTER 113 125 !$OMP BARRIER 114 126 jjb=jj_begin 115 127 jje=jj_end -
LMDZ5/branches/testing/libf/dyn3dmem/exner_milieu_loc.F
r1669 r1707 1 1 ! 2 ! $Id 2 ! $Id$ 3 3 ! 4 4 SUBROUTINE exner_milieu_loc ( ngrid, ps, p,beta, pks, pk, pkf ) … … 54 54 logical,save :: firstcall=.true. 55 55 !$OMP THREADPRIVATE(firstcall) 56 character(len=*),parameter :: modname="exner_milieu_ p"56 character(len=*),parameter :: modname="exner_milieu_loc" 57 57 58 58 ! Sanity check 59 59 if (firstcall) then 60 ! check that vertical discretization is compatible61 ! with this routine62 if (disvert_type.ne.2) then63 call abort_gcm(modname,64 & "this routine should only be called if disvert_type==2",42)65 endif66 60 67 61 ! sanity checks for Shallow Water case (1 vertical layer) … … 123 117 endif 124 118 !$OMP END MASTER 125 119 !$OMP BARRIER 126 120 jjb=jj_begin 127 121 jje=jj_end … … 171 165 endif 172 166 c$OMP END MASTER 167 c$OMP BARRIER 173 168 c 174 169 c -
LMDZ5/branches/testing/libf/dyn3dmem/filtreg_p.F
r1669 r1707 208 208 IF( ifiltre.EQ.-2 ) THEN 209 209 DO j = jdfil,jffil 210 #ifdef BLAS 210 211 CALL DGEMM("N", "N", iim, nbniv_loc, iim, 1.0, 211 212 & matrinvn(1,1,j), iim, 212 213 & champ_loc(1,j,1), iip1*nlat, 0.0, 213 214 & champ_fft(1,j-jdfil+1,1), iip1*nlat) 215 #else 216 champ_fft(:iim,j-jdfil+1,:) 217 & =matmul(matrinvn(:,:,j),champ_loc(:iim,j,:)) 218 #endif 214 219 ENDDO 215 220 216 221 ELSE IF ( griscal ) THEN 217 222 DO j = jdfil,jffil 223 #ifdef BLAS 218 224 CALL DGEMM("N", "N", iim, nbniv_loc, iim, 1.0, 219 225 & matriceun(1,1,j), iim, 220 226 & champ_loc(1,j,1), iip1*nlat, 0.0, 221 227 & champ_fft(1,j-jdfil+1,1), iip1*nlat) 228 #else 229 champ_fft(:iim,j-jdfil+1,:) 230 & =matmul(matriceun(:,:,j),champ_loc(:iim,j,:)) 231 #endif 222 232 ENDDO 223 233 224 234 ELSE 225 235 DO j = jdfil,jffil 236 #ifdef BLAS 226 237 CALL DGEMM("N", "N", iim, nbniv_loc, iim, 1.0, 227 238 & matricevn(1,1,j), iim, 228 239 & champ_loc(1,j,1), iip1*nlat, 0.0, 229 240 & champ_fft(1,j-jdfil+1,1), iip1*nlat) 241 #else 242 champ_fft(:iim,j-jdfil+1,:) 243 & =matmul(matricevn(:,:,j),champ_loc(:iim,j,:)) 244 #endif 230 245 ENDDO 231 246 … … 236 251 IF( ifiltre.EQ.-2 ) THEN 237 252 DO j = jdfil,jffil 253 #ifdef BLAS 238 254 CALL DGEMM("N", "N", iim, nbniv_loc, iim, 1.0, 239 255 & matrinvs(1,1,j-jfiltsu+1), iim, 240 256 & champ_loc(1,j,1), iip1*nlat, 0.0, 241 257 & champ_fft(1,j-jdfil+1,1), iip1*nlat) 258 #else 259 champ_fft(:iim,j-jdfil+1,:) 260 & =matmul(matrinvs(:,:,j-jfiltsu+1), 261 & champ_loc(:iim,j,:)) 262 #endif 242 263 ENDDO 243 264 … … 245 266 246 267 DO j = jdfil,jffil 268 #ifdef BLAS 247 269 CALL DGEMM("N", "N", iim, nbniv_loc, iim, 1.0, 248 270 & matriceus(1,1,j-jfiltsu+1), iim, 249 271 & champ_loc(1,j,1), iip1*nlat, 0.0, 250 272 & champ_fft(1,j-jdfil+1,1), iip1*nlat) 273 #else 274 champ_fft(:iim,j-jdfil+1,:) 275 & =matmul(matriceus(:,:,j-jfiltsu+1), 276 & champ_loc(:iim,j,:)) 277 #endif 251 278 ENDDO 252 279 … … 254 281 255 282 DO j = jdfil,jffil 283 #ifdef BLAS 256 284 CALL DGEMM("N", "N", iim, nbniv_loc, iim, 1.0, 257 285 & matricevs(1,1,j-jfiltsv+1), iim, 258 286 & champ_loc(1,j,1), iip1*nlat, 0.0, 259 287 & champ_fft(1,j-jdfil+1,1), iip1*nlat) 288 #else 289 champ_fft(:iim,j-jdfil+1,:) 290 & =matmul(matricevs(:,:,j-jfiltsv+1), 291 & champ_loc(:iim,j,:)) 292 #endif 260 293 ENDDO 261 294 -
LMDZ5/branches/testing/libf/dyn3dmem/friction_loc.F
r1669 r1707 6 6 USE parallel 7 7 USE control_mod 8 #ifdef CPP_IOIPSL 9 USE IOIPSL 10 #else 11 ! if not using IOIPSL, we still need to use (a local version of) getin 12 USE ioipsl_getincom 13 #endif 8 14 IMPLICIT NONE 9 15 10 c=======================================================================11 c 12 c 13 c Objet: 14 c ------ 15 c 16 c *********** 17 c Friction 18 c *********** 19 c 20 c=======================================================================16 !======================================================================= 17 ! 18 ! Friction for the Newtonian case: 19 ! -------------------------------- 20 ! 2 possibilities (depending on flag 'friction_type' 21 ! friction_type=0 : A friction that is only applied to the lowermost 22 ! atmospheric layer 23 ! friction_type=1 : Friction applied on all atmospheric layer (but 24 ! (default) with stronger magnitude near the surface; see 25 ! iniacademic.F) 26 !======================================================================= 21 27 22 28 #include "dimensions.h" … … 24 30 #include "comgeom2.h" 25 31 #include "comconst.h" 26 27 REAL pdt 32 #include "iniprint.h" 33 #include "academic.h" 34 35 ! arguments: 36 REAL,INTENT(inout) :: ucov( iip1,jjb_u:jje_u,llm ) 37 REAL,INTENT(inout) :: vcov( iip1,jjb_v:jje_v,llm ) 38 REAL,INTENT(in) :: pdt ! time step 39 40 ! local variables: 41 28 42 REAL modv(iip1,jjb_u:jje_u),zco,zsi 29 43 REAL vpn,vps,upoln,upols,vpols,vpoln 30 44 REAL u2(iip1,jjb_u:jje_u),v2(iip1,jjb_v:jje_v) 31 REAL ucov( iip1,jjb_u:jje_u,llm ),vcov( iip1,jjb_v:jje_v,llm ) 32 INTEGER i,j 33 REAL cfric 34 parameter (cfric=1.e-5) 45 INTEGER i,j,l 46 REAL,PARAMETER :: cfric=1.e-5 47 LOGICAL,SAVE :: firstcall=.true. 48 INTEGER,SAVE :: friction_type=1 49 CHARACTER(len=20) :: modname="friction_p" 50 CHARACTER(len=80) :: abort_message 51 !$OMP THREADPRIVATE(firstcall,friction_type) 35 52 integer :: jjb,jje 36 53 37 54 !$OMP SINGLE 55 IF (firstcall) THEN 56 ! set friction type 57 call getin("friction_type",friction_type) 58 if ((friction_type.lt.0).or.(friction_type.gt.1)) then 59 abort_message="wrong friction type" 60 write(lunout,*)'Friction: wrong friction type',friction_type 61 call abort_gcm(modname,abort_message,42) 62 endif 63 firstcall=.false. 64 ENDIF 65 !$OMP END SINGLE COPYPRIVATE(friction_type,firstcall) 66 67 if (friction_type.eq.0) then ! friction on first layer only 68 !$OMP SINGLE 38 69 c calcul des composantes au carre du vent naturel 39 70 jjb=jj_begin … … 138 169 vcov(iip1,j,1)=vcov(1,j,1) 139 170 enddo 171 !$OMP END SINGLE 172 endif ! of if (friction_type.eq.0) 173 174 if (friction_type.eq.1) then 175 ! for ucov() 176 jjb=jj_begin 177 jje=jj_end 178 if (pole_nord) jjb=jj_begin+1 179 if (pole_sud) jje=jj_end-1 180 181 !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 182 do l=1,llm 183 ucov(1:iip1,jjb:jje,l)=ucov(1:iip1,jjb:jje,l)* 184 & (1.-pdt*kfrict(l)) 185 enddo 186 !$OMP END DO NOWAIT 187 188 ! for vcoc() 189 jjb=jj_begin 190 jje=jj_end 191 if (pole_sud) jje=jj_end-1 192 193 !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 194 do l=1,llm 195 vcov(1:iip1,jjb:jje,l)=vcov(1:iip1,jjb:jje,l)* 196 & (1.-pdt*kfrict(l)) 197 enddo 198 !$OMP END DO 199 endif ! of if (friction_type.eq.1) 140 200 141 201 RETURN -
LMDZ5/branches/testing/libf/dyn3dmem/gcm.F
r1669 r1707 1 1 ! 2 ! $Id : gcm.F 1403 2010-07-01 09:02:53Z fairhead$2 ! $Id$ 3 3 ! 4 4 c … … 20 20 USE control_mod 21 21 22 ! Ehouarn: for now these only apply to Earth: 23 #ifdef CPP_EARTH 22 #ifdef CPP_PHYS 24 23 USE mod_grid_phy_lmdz 25 24 USE mod_phys_lmdz_para, ONLY : klon_mpi_para_nb … … 87 86 88 87 REAL zdtvr 89 c INTEGER nbetatmoy, nbetatdem,nbetat90 INTEGER nbetatmoy, nbetatdem91 88 92 89 c variables dynamiques … … 189 186 call ini_getparam("out.def") 190 187 call Read_Distrib 191 ! Ehouarn : temporarily (?) keep this only for Earth 192 if (planet_type.eq."earth") then 193 #ifdef CPP_EARTH 188 189 #ifdef CPP_PHYS 194 190 CALL Init_Phys_lmdz(iim,jjp1,llm,mpi_size,distrib_phys) 195 191 #endif 196 endif ! of if (planet_type.eq."earth")197 192 CALL set_bands 198 #ifdef CPP_EARTH 199 ! Ehouarn: For now only Earth physics is parallel 193 #ifdef CPP_PHYS 200 194 CALL Init_interface_dyn_phys 201 195 #endif … … 209 203 c$OMP END PARALLEL 210 204 211 ! Ehouarn : temporarily (?) keep this only for Earth 212 if (planet_type.eq."earth") then 213 #ifdef CPP_EARTH 205 #ifdef CPP_PHYS 214 206 c$OMP PARALLEL 215 207 call InitComgeomphy 216 208 c$OMP END PARALLEL 217 209 #endif 218 endif ! of if (planet_type.eq."earth")219 210 220 211 c----------------------------------------------------------------------- … … 240 231 #endif 241 232 242 IF ( config_inca /= 'none') THEN233 IF (type_trac == 'inca') THEN 243 234 #ifdef INCA 244 235 call init_const_lmdz( … … 282 273 endif 283 274 284 if (planet_type.eq."earth") then 285 #ifdef CPP_EARTH 275 ! if (planet_type.eq."earth") then 286 276 ! Load an Earth-format start file 287 277 CALL dynetat0_loc("start.nc",vcov,ucov, 288 278 & teta,q,masse,ps,phis, time_0) 289 #else 290 ! SW model also has Earth-format start files 291 ! (but can be used without the CPP_EARTH directive) 292 if (iflag_phys.eq.0) then 293 CALL dynetat0_loc("start.nc",vcov,ucov, 294 & teta,q,masse,ps,phis, time_0) 295 endif 296 #endif 297 endif ! of if (planet_type.eq."earth") 279 ! endif ! of if (planet_type.eq."earth") 280 298 281 c write(73,*) 'ucov',ucov 299 282 c write(74,*) 'vcov',vcov … … 337 320 C on remet le calendrier à zero si demande 338 321 c 322 IF (start_time /= starttime) then 323 WRITE(lunout,*)' GCM: Attention l''heure de depart lue dans le' 324 &,' fichier restart ne correspond pas à celle lue dans le run.def' 325 IF (raz_date == 1) then 326 WRITE(lunout,*)'Je prends l''heure lue dans run.def' 327 start_time = starttime 328 ELSE 329 WRITE(lunout,*)'Je m''arrete' 330 CALL abort 331 ENDIF 332 ENDIF 339 333 IF (raz_date == 1) THEN 340 334 annee_ref = anneeref … … 404 398 #endif 405 399 406 c nombre d'etats dans les fichiers demarrage et histoire407 nbetatdem = nday / iecri408 nbetatmoy = nday / periodav + 1409 400 410 401 c----------------------------------------------------------------------- 411 402 c Initialisation des constantes dynamiques : 412 403 c ------------------------------------------ 413 dtvr = zdtvr414 CALL iniconst404 dtvr = zdtvr 405 CALL iniconst 415 406 416 407 c----------------------------------------------------------------------- 417 408 c Initialisation de la geometrie : 418 409 c -------------------------------- 419 CALL inigeom410 CALL inigeom 420 411 421 412 c----------------------------------------------------------------------- 422 413 c Initialisation du filtre : 423 414 c -------------------------- 424 CALL inifilr415 CALL inifilr 425 416 c 426 417 c----------------------------------------------------------------------- … … 429 420 430 421 CALL inidissip( lstardis, nitergdiv, nitergrot, niterh , 431 * tetagdiv, tetagrot , tetatemp 422 * tetagdiv, tetagrot , tetatemp, vert_prof_dissip) 432 423 433 424 c----------------------------------------------------------------------- 434 425 c Initialisation de la physique : 435 426 c ------------------------------- 436 IF (call_iniphys.and. iflag_phys.eq.1) THEN427 IF (call_iniphys.and.(iflag_phys==1.or.iflag_phys>=100)) THEN 437 428 latfi(1)=rlatu(1) 438 429 lonfi(1)=0. … … 455 446 WRITE(lunout,*) 456 447 . 'GCM: WARNING!!! vitesse verticale nulle dans la physique' 457 ! Earth: 458 if (planet_type.eq."earth") then 459 #ifdef CPP_EARTH 460 CALL iniphysiq(ngridmx,llm,daysec,day_ini,dtphys/nsplit_phys , 461 , latfi,lonfi,airefi,zcufi,zcvfi,rad,g,r,cpp ) 462 #endif 463 endif ! of if (planet_type.eq."earth") 448 ! Physics: 449 #ifdef CPP_PHYS 450 CALL iniphysiq(ngridmx,llm,daysec,day_ini,dtphys/nsplit_phys, 451 & latfi,lonfi,airefi,zcufi,zcvfi,rad,g,r,cpp, 452 & iflag_phys) 453 #endif 464 454 call_iniphys=.false. 465 ENDIF ! of IF (call_iniphys.and.(iflag_phys .eq.1))455 ENDIF ! of IF (call_iniphys.and.(iflag_phys==1.or.iflag_phys>=100)) 466 456 467 457 … … 469 459 c Initialisation des dimensions d'INCA : 470 460 c -------------------------------------- 471 IF ( config_inca /= 'none') THEN461 IF (type_trac == 'inca') THEN 472 462 !$OMP PARALLEL 473 463 #ifdef INCA … … 496 486 #endif 497 487 498 if (planet_type.eq."earth") then 488 ! if (planet_type.eq."earth") then 489 ! Write an Earth-format restart file 499 490 CALL dynredem0_loc("restart.nc", day_end, phis) 500 endif491 ! endif 501 492 502 493 ecripar = .TRUE. … … 544 535 c write(78,*) 'q',q 545 536 546 c$OMP PARALLEL DEFAULT(SHARED) COPYIN(/temps/,/logic /)537 c$OMP PARALLEL DEFAULT(SHARED) COPYIN(/temps/,/logici/,/logicl/) 547 538 CALL leapfrog_loc(ucov,vcov,teta,ps,masse,phis,q,clesphy0, 548 539 . time_0) -
LMDZ5/branches/testing/libf/dyn3dmem/gr_dyn_fi_p.F
r1669 r1707 1 1 ! 2 ! $Id : gr_dyn_fi_p.F 1279 2009-12-10 09:02:56Z fairhead$2 ! $Id$ 3 3 ! 4 4 SUBROUTINE gr_dyn_fi_p(nfield,im,jm,ngrid,pdyn,pfi) 5 #ifdef CPP_ EARTH5 #ifdef CPP_PHYS 6 6 ! Interface with parallel physics, 7 ! for now this routine only works with Earth physics8 7 USE mod_interface_dyn_phys 9 8 USE dimphy … … 40 39 ENDDO 41 40 c$OMP END DO NOWAIT 42 #else43 write(lunout,*) "gr_fi_dyn_p : This routine should not be called",44 & "without parallelized physics"45 stop46 41 #endif 47 ! of #ifdef CPP_ EARTH42 ! of #ifdef CPP_PHYS 48 43 RETURN 49 44 END -
LMDZ5/branches/testing/libf/dyn3dmem/gr_fi_dyn_p.F
r1669 r1707 1 1 ! 2 ! $Id : gr_fi_dyn_p.F 1279 2009-12-10 09:02:56Z fairhead$2 ! $Id$ 3 3 ! 4 4 SUBROUTINE gr_fi_dyn_p(nfield,ngrid,im,jm,pfi,pdyn) 5 #ifdef CPP_ EARTH5 #ifdef CPP_PHYS 6 6 ! Interface with parallel physics, 7 ! for now this routine only works with Earth physics8 7 USE mod_interface_dyn_phys 9 8 USE dimphy … … 52 51 ENDDO 53 52 c$OMP END DO NOWAIT 54 #else55 write(lunout,*) "gr_fi_dyn_p : This routine should not be called",56 & "without parallelized physics"57 stop58 53 #endif 59 ! of #ifdef CPP_ EARTH54 ! of #ifdef CPP_PHYS 60 55 RETURN 61 56 END -
LMDZ5/branches/testing/libf/dyn3dmem/grid_noro.F
r1669 r1707 1 1 ! 2 ! $Id : grid_noro.F 1403 2010-07-01 09:02:53Z fairhead$2 ! $Id$ 3 3 ! 4 4 c … … 458 458 C MAKE A MOVING AVERAGE OVER 9 GRIDPOINTS OF THE X FIELDS 459 459 460 PARAMETER (ISMo=300,JSMo=200) 461 REAL X(IMAR,JMAR),XF(ISMo,JSMo) 460 REAL X(IMAR,JMAR),XF(IMAR,JMAR) 462 461 real WEIGHTpb(-1:1,-1:1) 463 462 464 if(imar.gt.ismo) stop'surdimensionner ismo dans mva9 (grid_noro)'465 if(jmar.gt.jsmo) stop'surdimensionner jsmo dans mva9 (grid_noro)'466 463 467 464 SUM=0. -
LMDZ5/branches/testing/libf/dyn3dmem/guide_loc_mod.F90
r1669 r1707 467 467 ! Calcul niveaux pression milieu de couches 468 468 CALL pression_loc( ijnb_u, ap, bp, ps, p ) 469 if ( disvert_type==1) then469 if (pressure_exner) then 470 470 CALL exner_hyb_loc(ip1jmp1,ps,p,alpha,beta,pks,pk,pkf) 471 471 else -
LMDZ5/branches/testing/libf/dyn3dmem/infotrac.F90
r1669 r1707 32 32 SUBROUTINE infotrac_init 33 33 USE control_mod 34 #ifdef REPROBUS 35 USE CHEM_REP, ONLY : Init_chem_rep_trac 36 #endif 34 37 IMPLICIT NONE 35 38 !======================================================================= … … 61 64 CHARACTER(len=1), DIMENSION(3) :: txts 62 65 CHARACTER(len=2), DIMENSION(9) :: txtp 63 CHARACTER(len= 13) :: str1,str266 CHARACTER(len=23) :: str1,str2 64 67 65 68 INTEGER :: nqtrue ! number of tracers read from tracer.def, without higer order of moment 66 69 INTEGER :: iq, new_iq, iiq, jq, ierr 67 INTEGER, EXTERNAL :: lnblnk 68 70 71 character(len=*),parameter :: modname="infotrac_init" 69 72 !----------------------------------------------------------------------- 70 73 ! Initialization : … … 85 88 86 89 87 IF (config_inca=='none') THEN 88 type_trac='lmdz' 90 ! Coherence test between parameter type_trac, config_inca and preprocessing keys 91 IF (type_trac=='inca') THEN 92 WRITE(lunout,*) 'You have choosen to couple with INCA chemestry model : type_trac=', & 93 type_trac,' config_inca=',config_inca 94 IF (config_inca/='aero' .AND. config_inca/='chem') THEN 95 WRITE(lunout,*) 'Incoherence between type_trac and config_inca. Model stops. Modify run.def' 96 CALL abort_gcm('infotrac_init','Incoherence between type_trac and config_inca',1) 97 END IF 98 #ifndef INCA 99 WRITE(lunout,*) 'To run this option you must add cpp key INCA and compile with INCA code' 100 CALL abort_gcm('infotrac_init','You must compile with cpp key INCA',1) 101 #endif 102 ELSE IF (type_trac=='repr') THEN 103 WRITE(lunout,*) 'You have choosen to couple with REPROBUS chemestry model : type_trac=', type_trac 104 #ifndef REPROBUS 105 WRITE(lunout,*) 'To run this option you must add cpp key REPROBUS and compile with REPRPBUS code' 106 CALL abort_gcm('infotrac_init','You must compile with cpp key REPROBUS',1) 107 #endif 108 ELSE IF (type_trac == 'lmdz') THEN 109 WRITE(lunout,*) 'Tracers are treated in LMDZ only : type_trac=', type_trac 89 110 ELSE 90 type_trac='inca' 91 END IF 111 WRITE(lunout,*) 'type_trac=',type_trac,' not possible. Model stops' 112 CALL abort_gcm('infotrac_init','bad parameter',1) 113 END IF 114 115 116 ! Test if config_inca is other then none for run without INCA 117 IF (type_trac/='inca' .AND. config_inca/='none') THEN 118 WRITE(lunout,*) 'config_inca will now be changed to none as you do not couple with INCA model' 119 config_inca='none' 120 END IF 121 92 122 93 123 !----------------------------------------------------------------------- … … 97 127 ! 98 128 !----------------------------------------------------------------------- 99 IF (type_trac == 'lmdz' ) THEN129 IF (type_trac == 'lmdz' .OR. type_trac == 'repr') THEN 100 130 OPEN(90,file='traceur.def',form='formatted',status='old', iostat=ierr) 101 131 IF(ierr.EQ.0) THEN 102 WRITE(lunout,*) 'Open traceur.def : ok'132 WRITE(lunout,*) trim(modname),': Open traceur.def : ok' 103 133 READ(90,*) nqtrue 104 134 ELSE 105 WRITE(lunout,*) 'Problem in opening traceur.def' 106 WRITE(lunout,*) 'ATTENTION using defaut values' 107 nqtrue=4 ! Defaut value 108 END IF 109 ! Attention! Only for planet_type=='earth' 110 nbtr=nqtrue-2 111 ELSE 112 ! nbtr has been read from INCA by init_cont_lmdz() in gcm.F 135 WRITE(lunout,*) trim(modname),': Problem in opening traceur.def' 136 WRITE(lunout,*) trim(modname),': WARNING using defaut values' 137 if (planet_type=='earth') then 138 nqtrue=4 ! Default value for Earth 139 else 140 nqtrue=1 ! Default value for other planets 141 endif 142 END IF 143 if ( planet_type=='earth') then 144 ! For Earth, water vapour & liquid tracers are not in the physics 145 nbtr=nqtrue-2 146 else 147 ! Other planets (for now); we have the same number of tracers 148 ! in the dynamics than in the physics 149 nbtr=nqtrue 150 endif 151 ELSE ! type_trac=inca 152 ! nbtr has been read from INCA by init_const_lmdz() in gcm.F 113 153 nqtrue=nbtr+2 114 154 END IF 115 155 116 IF ( nqtrue < 2) THEN117 WRITE(lunout,*) 'nqtrue=',nqtrue, ' is not allowded. 2 tracers is the minimum'156 IF ((planet_type=="earth").and.(nqtrue < 2)) THEN 157 WRITE(lunout,*) trim(modname),': nqtrue=',nqtrue, ' is not allowded. 2 tracers is the minimum' 118 158 CALL abort_gcm('infotrac_init','Not enough tracers',1) 119 159 END IF 160 161 ! Transfert number of tracers to Reprobus 162 IF (type_trac == 'repr') THEN 163 #ifdef REPROBUS 164 CALL Init_chem_rep_trac(nbtr) 165 #endif 166 END IF 167 120 168 ! 121 169 ! Allocate variables depending on nqtrue and nbtr … … 152 200 ! Get choice of advection schema from file tracer.def or from INCA 153 201 !--------------------------------------------------------------------- 154 IF (type_trac == 'lmdz' ) THEN202 IF (type_trac == 'lmdz' .OR. type_trac == 'repr') THEN 155 203 IF(ierr.EQ.0) THEN 156 204 ! Continue to read tracer.def 157 205 DO iq=1,nqtrue 158 READ(90, 999) hadv(iq),vadv(iq),tnom_0(iq)206 READ(90,*) hadv(iq),vadv(iq),tnom_0(iq) 159 207 END DO 160 208 CLOSE(90) 161 ELSE ! Without tracer.def 209 ELSE ! Without tracer.def, set default values 210 if (planet_type=="earth") then 211 ! for Earth, default is to have 4 tracers 162 212 hadv(1) = 14 163 213 vadv(1) = 14 … … 172 222 vadv(4) = 10 173 223 tnom_0(4) = 'PB' 224 else ! default for other planets 225 hadv(1) = 10 226 vadv(1) = 10 227 tnom_0(1) = 'dummy' 228 endif ! of if (planet_type=="earth") 174 229 END IF 175 230 176 WRITE(lunout,*) 'Valeur de traceur.def :'177 WRITE(lunout,*) 'nombre de traceurs ',nqtrue231 WRITE(lunout,*) trim(modname),': Valeur de traceur.def :' 232 WRITE(lunout,*) trim(modname),': nombre de traceurs ',nqtrue 178 233 DO iq=1,nqtrue 179 234 WRITE(lunout,*) hadv(iq),vadv(iq),tnom_0(iq) … … 217 272 new_iq=new_iq+10 ! 9 tracers added 218 273 ELSE 219 WRITE(lunout,*) 'This choice of advection schema is not available'274 WRITE(lunout,*) trim(modname),': This choice of advection schema is not available',iq,hadv(iq),vadv(iq) 220 275 CALL abort_gcm('infotrac_init','Bad choice of advection schema - 1',1) 221 276 END IF … … 227 282 nqtot = new_iq 228 283 229 WRITE(lunout,*) 'The choice of advection schema for one or more tracers'284 WRITE(lunout,*) trim(modname),': The choice of advection schema for one or more tracers' 230 285 WRITE(lunout,*) 'makes it necessary to add tracers' 231 WRITE(lunout,*) nqtrue,' is the number of true tracers'232 WRITE(lunout,*) nqtot, ' is the total number of tracers needed'286 WRITE(lunout,*) trim(modname)//': ',nqtrue,' is the number of true tracers' 287 WRITE(lunout,*) trim(modname)//': ',nqtot, ' is the total number of tracers needed' 233 288 234 289 ELSE … … 258 313 iadv(new_iq)=11 259 314 ELSE 260 WRITE(lunout,*)'This choice of advection schema is not available' 315 WRITE(lunout,*)trim(modname),': This choice of advection schema is not available',iq,hadv(iq),vadv(iq) 316 261 317 CALL abort_gcm('infotrac_init','Bad choice of advection schema - 2',1) 262 318 END IF … … 265 321 tname(new_iq)= tnom_0(iq) 266 322 IF (iadv(new_iq)==0) THEN 267 ttext(new_iq)= str1(1:lnblnk(str1))323 ttext(new_iq)=trim(str1) 268 324 ELSE 269 ttext(new_iq)= str1(1:lnblnk(str1))//descrq(iadv(new_iq))325 ttext(new_iq)=trim(tnom_0(iq))//descrq(iadv(new_iq)) 270 326 END IF 271 327 … … 276 332 new_iq=new_iq+1 277 333 iadv(new_iq)=-20 278 ttext(new_iq)= str2(1:lnblnk(str2))//txts(jq)279 tname(new_iq)= str1(1:lnblnk(str1))//txts(jq)334 ttext(new_iq)=trim(str2)//txts(jq) 335 tname(new_iq)=trim(str1)//txts(jq) 280 336 END DO 281 337 ELSE IF (iadv(new_iq)==30) THEN … … 283 339 new_iq=new_iq+1 284 340 iadv(new_iq)=-30 285 ttext(new_iq)= str2(1:lnblnk(str2))//txtp(jq)286 tname(new_iq)= str1(1:lnblnk(str1))//txtp(jq)341 ttext(new_iq)=trim(str2)//txtp(jq) 342 tname(new_iq)=trim(str1)//txtp(jq) 287 343 END DO 288 344 END IF … … 303 359 304 360 305 WRITE(lunout,*) 'Information stored in infotrac :'306 WRITE(lunout,*) 'iadv niadv tname ttext :'361 WRITE(lunout,*) trim(modname),': Information stored in infotrac :' 362 WRITE(lunout,*) trim(modname),': iadv niadv tname ttext :' 307 363 DO iq=1,nqtot 308 WRITE(lunout,*) iadv(iq),niadv(iq), tname(iq), ttext(iq) 364 WRITE(lunout,*) iadv(iq),niadv(iq),& 365 ' ',trim(tname(iq)),' ',trim(ttext(iq)) 309 366 END DO 310 367 … … 315 372 DO iq=1,nqtot 316 373 IF (iadv(iq)/=10 .AND. iadv(iq)/=14 .AND. iadv(iq)/=0) THEN 317 WRITE(lunout,*) 'STOP : The option iadv=',iadv(iq),' is not tested in this version of LMDZ'374 WRITE(lunout,*)trim(modname),' STOP : The option iadv=',iadv(iq),' is not tested in this version of LMDZ' 318 375 CALL abort_gcm('infotrac_init','In this version only iadv=10 and iadv=14 is tested!',1) 319 376 ELSE IF (iadv(iq)==14 .AND. iq/=1) THEN 320 WRITE(lunout,*) 'STOP : The option iadv=',iadv(iq),' is not tested in this version of LMDZ'377 WRITE(lunout,*)trim(modname),'STOP : The option iadv=',iadv(iq),' is not tested in this version of LMDZ' 321 378 CALL abort_gcm('infotrac_init','In this version iadv=14 is only permitted for water vapour!',1) 322 379 END IF … … 329 386 DEALLOCATE(tracnam) 330 387 331 999 FORMAT (i2,1x,i2,1x,a15)332 333 388 END SUBROUTINE infotrac_init 334 389 -
LMDZ5/branches/testing/libf/dyn3dmem/inigrads.F
r1669 r1707 9 9 implicit none 10 10 11 integer if,im,jm,lm,i,j,l ,lnblnk11 integer if,im,jm,lm,i,j,l 12 12 real x(im),y(jm),z(lm),fx,fy,fz,dt 13 13 real xmin,xmax,ymin,ymax … … 40 40 ivar(if)=0 41 41 42 fichier(if)= file(1:lnblnk(file))42 fichier(if)=trim(file) 43 43 44 44 firsttime(if)=.true. … … 70 70 71 71 print*,4*(ifd(if)-iid(if))*(jfd(if)-jid(if)) 72 print*, file(1:lnblnk(file))//'.dat'72 print*,trim(file)//'.dat' 73 73 74 OPEN (unit(if)+1,FILE= file(1:lnblnk(file))//'.dat'74 OPEN (unit(if)+1,FILE=trim(file)//'.dat' 75 75 s ,FORM='unformatted', 76 76 s ACCESS='direct' -
LMDZ5/branches/testing/libf/dyn3dmem/initfluxsto_p.F
r1669 r1707 1 1 ! 2 ! $Id : initfluxsto_p.F 1279 2009-12-10 09:02:56Z fairhead$2 ! $Id$ 3 3 ! 4 4 subroutine initfluxsto_p … … 203 203 . llm, nivsigs, zvertiid) 204 204 c pour le fichier def 205 nivd(1) = 1 206 call histvert(filedid, 'sig_s', 'Niveaux sigma', 207 . 'sigma_level', 208 . 1, nivd, dvertiid) 209 205 if (mpi_rank==0) then 206 nivd(1) = 1 207 call histvert(filedid, 'sig_s', 'Niveaux sigma', 208 . 'sigma_level', 209 . 1, nivd, dvertiid) 210 endif 210 211 C 211 212 C Appels a histdef pour la definition des variables a sauvegarder … … 282 283 call histend(fileid) 283 284 call histend(filevid) 284 call histend(filedid)285 if (mpi_rank==0) call histend(filedid) 285 286 if (ok_sync) then 286 287 call histsync(fileid) 287 288 call histsync(filevid) 288 call histsync(filedid)289 if (mpi_rank==0) call histsync(filedid) 289 290 endif 290 291 -
LMDZ5/branches/testing/libf/dyn3dmem/integrd_loc.F
r1669 r1707 4 4 SUBROUTINE integrd_loc 5 5 $ ( nq,vcovm1,ucovm1,tetam1,psm1,massem1, 6 $ dv,du,dteta,dq,dp,vcov,ucov,teta,q,ps0,masse,phis ,finvmaold)6 $ dv,du,dteta,dq,dp,vcov,ucov,teta,q,ps0,masse,phis) !,finvmaold) 7 7 USE parallel 8 8 USE control_mod … … 37 37 #include "temps.h" 38 38 #include "serre.h" 39 include 'mpif.h' 39 #include "iniprint.h" 40 ! include 'mpif.h' 40 41 41 42 c Arguments: 42 43 c ---------- 43 44 44 INTEGER nq 45 46 REAL vcov(ijb_v:ije_v,llm),ucov(ijb_u:ije_u,llm) 47 REAL teta(ijb_u:ije_u,llm) 48 REAL q(ijb_u:ije_u,llm,nq) 49 REAL ps0(ijb_u:ije_u),masse(ijb_u:ije_u,llm),phis(ijb_u:ije_u) 50 51 REAL vcovm1(ijb_v:ije_v,llm),ucovm1(ijb_u:ije_u,llm) 52 REAL tetam1(ijb_u:ije_u,llm),psm1(ijb_u:ije_u) 53 REAL massem1(ijb_u:ije_u,llm) 54 55 REAL dv(ijb_v:ije_v,llm),du(ijb_u:ije_u,llm) 56 REAL dteta(ijb_u:ije_u,llm),dp(ijb_u:ije_u) 57 REAL dq(ijb_u:ije_u,llm,nq), finvmaold(ijb_u:ije_u,llm) 45 INTEGER,intent(in) :: nq ! number of tracers to handle in this routine 46 47 REAL,INTENT(INOUT) :: vcov(ijb_v:ije_v,llm) ! covariant meridional wind 48 REAL,INTENT(INOUT) :: ucov(ijb_u:ije_u,llm) ! covariant zonal wind 49 REAL,INTENT(INOUT) :: teta(ijb_u:ije_u,llm) ! potential temperature 50 REAL,INTENT(INOUT) :: q(ijb_u:ije_u,llm,nq) ! advected tracers 51 REAL,INTENT(INOUT) :: ps0(ijb_u:ije_u) ! surface pressure 52 REAL,INTENT(INOUT) :: masse(ijb_u:ije_u,llm) ! atmospheric mass 53 REAL,INTENT(INOUT) :: phis(ijb_u:ije_u) ! ground geopotential !!! unused 54 ! values at previous time step 55 REAL,INTENT(INOUT) :: vcovm1(ijb_v:ije_v,llm) 56 REAL,INTENT(INOUT) :: ucovm1(ijb_u:ije_u,llm) 57 REAL,INTENT(INOUT) :: tetam1(ijb_u:ije_u,llm) 58 REAL,INTENT(INOUT) :: psm1(ijb_u:ije_u) 59 REAL,INTENT(INOUT) :: massem1(ijb_u:ije_u,llm) 60 ! the tendencies to add 61 REAL,INTENT(INOUT) :: dv(ijb_v:ije_v,llm) 62 REAL,INTENT(INOUT) :: du(ijb_u:ije_u,llm) 63 REAL,INTENT(INOUT) :: dteta(ijb_u:ije_u,llm) 64 REAL,INTENT(INOUT) :: dp(ijb_u:ije_u) 65 REAL,INTENT(INOUT) :: dq(ijb_u:ije_u,llm,nq) !!! unused 66 ! REAL,INTENT(INOUT) ::finvmaold(ijb_u:ije_u,llm) !!! unused 58 67 59 68 c Local: … … 62 71 REAL vscr( ijb_v:ije_v ),uscr( ijb_u:ije_u ) 63 72 REAL hscr( ijb_u:ije_u ),pscr(ijb_u:ije_u) 64 REAL massescr( ijb_u:ije_u,llm ), finvmasse(ijb_u:ije_u,llm) 73 REAL massescr( ijb_u:ije_u,llm ) 74 ! REAL finvmasse(ijb_u:ije_u,llm) 65 75 REAL tpn,tps,tppn(iim),tpps(iim) 66 76 REAL qpn,qps,qppn(iim),qpps(iim) 67 77 68 INTEGER l,ij,iq 78 INTEGER l,ij,iq,i,j 69 79 70 80 REAL SSUM … … 74 84 LOGICAL,SAVE :: checksum_all=.TRUE. 75 85 INTEGER :: stop_it 76 INTEGER :: ierr ,j86 INTEGER :: ierr 77 87 78 88 c----------------------------------------------------------------------- … … 137 147 ! & MPI_LOGICAL,MPI_LOR,COMM_LMDZ,ierr) 138 148 IF( .NOT. checksum ) THEN 139 PRINT*,' Au point ij = ',stop_it, ' , pression sol neg. ' 140 & , ps(stop_it) 141 STOP' dans integrd' 142 ENDIF 149 write(lunout,*) "integrd: negative surface pressure ", 150 & ps(stop_it) 151 write(lunout,*) " at node ij =", stop_it 152 ! since ij=j+(i-1)*jjp1 , we have 153 ! j=modulo(stop_it,jjp1) 154 ! i=1+(stop_it-j)/jjp1 155 ! write(lunout,*) " lon = ",rlonv(i)*180./pi, " deg", 156 ! & " lat = ",rlatu(j)*180./pi, " deg" 157 ENDIF 158 143 159 c$OMP END MASTER 144 160 c$OMP BARRIER … … 160 176 call WriteField_u('int_dteta',dteta) 161 177 call WriteField_u('int_dp',dp) 162 call WriteField_u('int_finvmaold',finvmaold)178 ! call WriteField_u('int_finvmaold',finvmaold) 163 179 do j=1,nq 164 180 call WriteField_u('int_q'//trim(int2str(j)), … … 206 222 CALL massdair_loc ( p , masse ) 207 223 208 c CALL SCOPY( ijp1llm , masse, 1, finvmasse, 1 ) 209 ijb=ij_begin 210 ije=ij_end 211 212 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 213 DO l = 1,llm 214 finvmasse(ijb:ije,l)=masse(ijb:ije,l) 215 ENDDO 216 c$OMP END DO NOWAIT 217 218 jjb=jj_begin 219 jje=jj_end 220 CALL filtreg_p( finvmasse,jjb_u,jje_u,jjb,jje, jjp1, llm, 221 & -2, 2, .TRUE., 1 ) 224 ! Ehouarn : we don't use/need finvmaold and finvmasse, 225 ! so might as well not compute them 226 !c CALL SCOPY( ijp1llm , masse, 1, finvmasse, 1 ) 227 ! ijb=ij_begin 228 ! ije=ij_end 229 ! 230 !c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 231 ! DO l = 1,llm 232 ! finvmasse(ijb:ije,l)=masse(ijb:ije,l) 233 ! ENDDO 234 !c$OMP END DO NOWAIT 235 236 ! jjb=jj_begin 237 ! jje=jj_end 238 ! CALL filtreg_p( finvmasse,jjb_u,jje_u,jjb,jje, jjp1, llm, 239 ! & -2, 2, .TRUE., 1 ) 222 240 c 223 241 … … 320 338 321 339 CALL qminimum_loc( q, nq, deltap ) 322 endif ! of if (planet_type.eq."earth")323 340 c 324 341 c ..... Calcul de la valeur moyenne, unique aux poles pour q ..... … … 371 388 ENDIF 372 389 373 c CALL SCOPY( ijp1llm , finvmasse, 1, finvmaold, 1 ) 374 375 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 376 DO l = 1, llm 377 finvmaold(ijb:ije,l)=finvmasse(ijb:ije,l) 378 ENDDO 379 c$OMP END DO NOWAIT 390 ! Ehouarn: forget about finvmaold 391 !c CALL SCOPY( ijp1llm , finvmasse, 1, finvmaold, 1 ) 392 393 !c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 394 ! DO l = 1, llm 395 ! finvmaold(ijb:ije,l)=finvmasse(ijb:ije,l) 396 ! ENDDO 397 !c$OMP END DO NOWAIT 398 399 endif ! of if (planet_type.eq."earth") 400 380 401 c 381 402 c -
LMDZ5/branches/testing/libf/dyn3dmem/leapfrog_loc.F
r1669 r1707 1 1 ! 2 ! $Id : leapfrog_p.F 1299 2010-01-20 14:27:21Z fairhead$2 ! $Id$ 3 3 ! 4 4 c … … 78 78 #include "iniprint.h" 79 79 #include "academic.h" 80 include "mpif.h"80 ! include "mpif.h" 81 81 82 82 INTEGER longcles … … 119 119 120 120 c tendances physiques 121 !REAL,SAVE,ALLOCATABLE :: dvfi(:,:),dufi(:,:)122 !REAL,SAVE,ALLOCATABLE :: dtetafi(:,:)123 !REAL,SAVE,ALLOCATABLE :: dpfi(:)124 !REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: dqfi121 REAL,SAVE,ALLOCATABLE :: dvfi(:,:),dufi(:,:) 122 REAL,SAVE,ALLOCATABLE :: dtetafi(:,:) 123 REAL,SAVE,ALLOCATABLE :: dpfi(:) 124 REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: dqfi 125 125 126 126 c variables pour le fichier histoire … … 150 150 REAL :: secondes 151 151 152 logical :: physic 152 153 LOGICAL first,callinigrads 153 154 … … 174 175 175 176 character*80 dynhist_file, dynhistave_file 176 character *20 modname177 character(len=*),parameter :: modname="leapfrog_loc" 177 178 character*80 abort_message 178 179 … … 195 196 196 197 INTEGER :: true_itau 197 LOGICAL :: verbose=.true.198 198 INTEGER :: iapptrac 199 199 INTEGER :: AdjustCount … … 215 215 itaufin = nday*day_step 216 216 itaufinp1 = itaufin +1 217 modname="leapfrog_p"218 217 219 218 itau = 0 219 physic=.true. 220 if (iflag_phys==0.or.iflag_phys==2) physic=.false. 220 221 CALL init_nan 221 222 CALL leapfrog_allocate … … 236 237 237 238 c Allocate variables depending on dynamic variable nqtot 238 !c$OMP MASTER 239 !$OMP MASTER 240 if (firstcall) then 239 241 ! 240 242 ! ALLOCATE(p(ijb_u:ije_u,llmp1)) … … 252 254 ! ALLOCATE(dvdis(ijb_v:ije_v,llm),dudis(ijb_u:ije_u,llm)) 253 255 ! ALLOCATE(dtetadis(ijb_u:ije_u,llm)) 254 !ALLOCATE(dvfi(ijb_v:ije_v,llm),dufi(ijb_u:ije_u,llm))255 !ALLOCATE(dtetafi(ijb_u:ije_u,llm))256 !ALLOCATE(dpfi(ijb_u:ije_u))256 ALLOCATE(dvfi(ijb_v:ije_v,llm),dufi(ijb_u:ije_u,llm)) 257 ALLOCATE(dtetafi(ijb_u:ije_u,llm)) 258 ALLOCATE(dpfi(ijb_u:ije_u)) 257 259 ! ALLOCATE(dq(ijb_u:ije_u,llm,nqtot)) 258 !ALLOCATE(dqfi(ijb_u:ije_u,llm,nqtot))260 ALLOCATE(dqfi(ijb_u:ije_u,llm,nqtot)) 259 261 ! ALLOCATE(dqfi_tmp(iip1,llm,nqtot)) 260 262 ! ALLOCATE(finvmaold(ijb_u:ije_u,llm)) … … 265 267 ! ALLOCATE(vcont(ijb_v:ije_v,llm),ucont(ijb_u:ije_u,llm)) 266 268 ! ALLOCATE(vnat(ijb_v:ije_v,llm),unat(ijb_u:ije_u,llm)) 267 !c$OMP END MASTER 268 !c$OMP BARRIER 269 endif 270 !$OMP END MASTER 271 !$OMP BARRIER 269 272 270 273 ! CALL dynredem1_loc("restart.nc",0.0, … … 277 280 278 281 c$OMP MASTER 279 dq =0.282 dq(:,:,:)=0. 280 283 CALL pression ( ijnb_u, ap, bp, ps, p ) 281 284 c$OMP END MASTER 285 if (pressure_exner) then 282 286 CALL exner_hyb_loc( ijnb_u, ps, p,alpha,beta, pks, pk, pkf) 283 287 else 288 CALL exner_milieu_loc( ijnb_u, ps, p, beta, pks, pk, pkf ) 289 endif 284 290 c----------------------------------------------------------------------- 285 291 c Debut de l'integration temporelle: … … 287 293 c et du parallelisme !! 288 294 289 1 CONTINUE 290 291 jD_cur = jD_ref + day_ini - day_ref + int (itau * dtvr / daysec) 292 jH_cur = jH_ref + & 293 & (itau * dtvr / daysec - int(itau * dtvr / daysec)) 295 1 CONTINUE ! Matsuno Forward step begins here 296 297 jD_cur = jD_ref + day_ini - day_ref + & 298 & itau/day_step 299 jH_cur = jH_ref + start_time + & 300 & mod(itau,day_step)/float(day_step) 301 if (jH_cur > 1.0 ) then 302 jD_cur = jD_cur +1. 303 jH_cur = jH_cur -1. 304 endif 305 294 306 295 307 #ifdef CPP_IOIPSL … … 323 335 psm1= ps 324 336 325 finvmaold = masse 326 c$OMP END MASTER 327 c$OMP BARRIER 328 CALL filtreg_p ( finvmaold ,jjb_u,jje_u,jjb_u,jje_u,jjp1, llm, 329 & -2,2, .TRUE., 1 ) 337 ! Ehouarn: finvmaold is actually not used 338 ! finvmaold = masse 339 c$OMP END MASTER 340 c$OMP BARRIER 341 ! CALL filtreg_p ( finvmaold ,jjb_u,jje_u,jjb_u,jje_u,jjp1, llm, 342 ! & -2,2, .TRUE., 1 ) 330 343 else 331 344 ! Save fields obtained at previous time step as '...m1' … … 343 356 tetam1 (ijb:ije,l) = teta (ijb:ije,l) 344 357 massem1 (ijb:ije,l) = masse (ijb:ije,l) 345 finvmaold(ijb:ije,l)=masse(ijb:ije,l)358 ! finvmaold(ijb:ije,l)=masse(ijb:ije,l) 346 359 347 360 if (pole_sud) ije=ij_end-iip1 … … 353 366 354 367 355 CALL filtreg_p(finvmaold ,jjb_u,jje_u,jj_begin,jj_end,jjp1, 356 . llm, -2,2, .TRUE., 1 ) 368 ! Ehouarn: finvmaold not used 369 ! CALL filtreg_p(finvmaold ,jjb_u,jje_u,jj_begin,jj_end,jjp1, 370 ! . llm, -2,2, .TRUE., 1 ) 357 371 358 372 endif ! of if (FirstCaldyn) … … 370 384 cym call minmax(ijp1llm,q(:,:,3),zqmin,zqmax) 371 385 372 2 CONTINUE 386 2 CONTINUE ! Matsuno backward or leapfrog step begins here 373 387 374 388 c$OMP MASTER 375 389 ItCount=ItCount+1 376 if (MOD(ItCount,1)== 0) then390 if (MOD(ItCount,1)==1) then 377 391 debug=.true. 378 392 else … … 399 413 ! Purely Matsuno time stepping 400 414 IF( MOD(itau,iconser) .EQ.0.AND. forward ) conser = .TRUE. 401 IF( MOD(itau,idissip ).EQ.0.AND..NOT.forward ) apdiss = .TRUE. 415 IF( MOD(itau,dissip_period ).EQ.0.AND..NOT.forward ) 416 s apdiss = .TRUE. 402 417 IF( MOD(itau,iphysiq ).EQ.0.AND..NOT.forward 403 s .and. iflag_phys.EQ.1) apphys = .TRUE.418 s .and. physic ) apphys = .TRUE. 404 419 ELSE 405 420 ! Leapfrog/Matsuno time stepping 406 421 IF( MOD(itau ,iconser) .EQ. 0 ) conser = .TRUE. 407 IF( MOD(itau+1,idissip) .EQ. 0 ) apdiss = .TRUE. 408 IF( MOD(itau+1,iphysiq).EQ.0.AND.iflag_phys.EQ.1) apphys=.TRUE. 422 IF( MOD(itau+1,dissip_period).EQ.0 .AND. .NOT. forward ) 423 s apdiss = .TRUE. 424 IF( MOD(itau+1,iphysiq).EQ.0.AND.physic) apphys=.TRUE. 409 425 END IF 410 426 … … 450 466 c$OMP MASTER 451 467 call allgather_timer_average 452 verbose=.TRUE. 453 if ( Verbose) then468 469 if (prt_level > 9) then 454 470 455 471 print *,'*********************************' … … 622 638 call start_timer(timer_caldyn) 623 639 640 ! compute geopotential phi() 624 641 CALL geopot_loc ( ip1jmp1, teta , pk , pks, phis , phi ) 625 642 … … 697 714 698 715 CALL integrd_loc ( 2,vcovm1,ucovm1,tetam1,psm1,massem1 , 699 $ dv,du,dteta,dq,dp,vcov,ucov,teta,q,ps,masse,phis ,700 $ finvmaold )716 $ dv,du,dteta,dq,dp,vcov,ucov,teta,q,ps,masse,phis) 717 ! $ finvmaold ) 701 718 702 719 ! CALL FTRACE_REGION_END("integrd") … … 1081 1098 !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 1082 1099 do l=1,llm 1083 teta(ijb:ije,l)=teta(ijb:ije,l) 1084 & -iphysiq*dtvr*(teta(ijb:ije,l)-tetarappel(ijb:ije,l))/taurappel 1100 teta(ijb:ije,l)=teta(ijb:ije,l) -dtvr* 1101 & (teta(ijb:ije,l)-tetarappel(ijb:ije,l))* 1102 & (knewt_g+knewt_t(l)*clat4(ijb:ije)) 1085 1103 enddo 1086 1104 !$OMP END DO 1105 1106 !$OMP MASTER 1107 if (planet_type.eq."giant") then 1108 ! add an intrinsic heat flux at the base of the atmosphere 1109 teta(ijb:ije,1) = teta(ijb:ije,1) 1110 & + dtvr * aire(ijb:ije) * ihf / cpp / masse(ijb:ije,1) 1111 endif 1112 !$OMP END MASTER 1113 !$OMP BARRIER 1114 1087 1115 1088 1116 call Register_Hallo_u(ucov,llm,0,1,1,0,Request_Physic) … … 1092 1120 call WaitRequest(Request_Physic) 1093 1121 c$OMP BARRIER 1094 call friction_loc(ucov,vcov, iphysiq*dtvr)1122 call friction_loc(ucov,vcov,dtvr) 1095 1123 !$OMP BARRIER 1124 1125 ! Sponge layer (if any) 1126 IF (ok_strato) THEN 1127 ! set dufi,dvfi,... to zero 1128 ijb=ij_begin 1129 ije=ij_end 1130 !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 1131 do l=1,llm 1132 dufi(ijb:ije,l)=0 1133 dtetafi(ijb:ije,l)=0 1134 dqfi(ijb:ije,l,1:nqtot)=0 1135 enddo 1136 !$OMP END DO 1137 !$OMP MASTER 1138 dpfi(ijb:ije)=0 1139 !$OMP END MASTER 1140 ijb=ij_begin 1141 ije=ij_end 1142 if (pole_sud) ije=ije-iip1 1143 !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 1144 do l=1,llm 1145 dvfi(ijb:ije,l)=0 1146 enddo 1147 !$OMP END DO 1148 1149 CALL top_bound_loc(vcov,ucov,teta,masse,dufi,dvfi,dtetafi) 1150 CALL addfi_loc( dtvr, leapf, forward , 1151 $ ucov, vcov, teta , q ,ps , 1152 $ dufi, dvfi, dtetafi , dqfi ,dpfi ) 1153 !$OMP BARRIER 1154 ENDIF ! of IF (ok_strato) 1096 1155 ENDIF ! of IF(iflag_phys.EQ.2) 1097 1156 … … 1099 1158 CALL pression_loc ( ip1jmp1, ap, bp, ps, p ) 1100 1159 c$OMP BARRIER 1101 CALL exner_hyb_loc( ip1jmp1, ps, p,alpha,beta, pks, pk, pkf ) 1160 if (pressure_exner) then 1161 CALL exner_hyb_loc( ijnb_u, ps, p,alpha,beta, pks, pk, pkf ) 1162 else 1163 CALL exner_milieu_loc( ijnb_u, ps, p, beta, pks, pk, pkf ) 1164 endif 1102 1165 c$OMP BARRIER 1103 1166 … … 1496 1559 c$OMP BARRIER 1497 1560 1498 if (planet_type.eq."earth") then1561 ! if (planet_type.eq."earth") then 1499 1562 ! Write an Earth-format restart file 1500 1563 CALL dynredem1_loc("restart.nc",0.0, 1501 1564 & vcov,ucov,teta,q,masse,ps) 1502 endif ! of if (planet_type.eq."earth")1565 ! endif ! of if (planet_type.eq."earth") 1503 1566 1504 1567 ! CLOSE(99) … … 1608 1671 1609 1672 IF(itau.EQ.itaufin) THEN 1610 if (planet_type.eq."earth") then1673 ! if (planet_type.eq."earth") then 1611 1674 CALL dynredem1_loc("restart.nc",0.0, 1612 1675 . vcov,ucov,teta,q,masse,ps) 1613 1676 ! endif ! of if (planet_type.eq."earth") 1614 1677 ENDIF ! of IF(itau.EQ.itaufin) 1615 1678 -
LMDZ5/branches/testing/libf/dyn3dmem/limy.F
r1669 r1707 1 ! 2 ! $Header$3 ! 1 c 2 c $Id$ 3 c 4 4 SUBROUTINE limy(s0,sy,sm,pente_max) 5 5 c … … 40 40 REAL qbyv(ip1jm,llm) 41 41 42 REAL qpns,qpsn,ap n,aps,dyn1,dys1,dyn2,dys242 REAL qpns,qpsn,appn,apps,dyn1,dys1,dyn2,dys2 43 43 Logical extremum,first 44 44 save first … … 52 52 REAL SSUM 53 53 integer ismax,ismin 54 EXTERNAL SSUM, ismin,ismax 54 EXTERNAL SSUM, convflu,ismin,ismax 55 EXTERNAL filtreg 55 56 56 57 data first/.true./ … … 116 117 117 118 c print*,dyqv(iip1+1) 118 c ap n=abs(dyq(1)/dyqv(iip1+1))119 c appn=abs(dyq(1)/dyqv(iip1+1)) 119 120 c print*,dyq(ip1jm+1) 120 121 c print*,dyqv(ip1jm-iip1+1) 121 c ap s=abs(dyq(ip1jm+1)/dyqv(ip1jm-iip1+1))122 c apps=abs(dyq(ip1jm+1)/dyqv(ip1jm-iip1+1)) 122 123 c do ij=2,iim 123 c ap n=amax1(abs(dyq(ij)/dyqv(ij)),apn)124 c ap s=amax1(abs(dyq(ip1jm+ij)/dyqv(ip1jm-iip1+ij)),aps)124 c appn=amax1(abs(dyq(ij)/dyqv(ij)),appn) 125 c apps=amax1(abs(dyq(ip1jm+ij)/dyqv(ip1jm-iip1+ij)),apps) 125 126 c enddo 126 c ap n=min(pente_max/apn,1.)127 c ap s=min(pente_max/aps,1.)127 c appn=min(pente_max/appn,1.) 128 c apps=min(pente_max/apps,1.) 128 129 129 130 … … 131 132 132 133 c if(dyqv(ismin(iim,dyqv,1))*dyqv(ismax(iim,dyqv,1)).le.0.) 133 c & ap n=0.134 c & appn=0. 134 135 c if(dyqv(ismax(iim,dyqv(ip1jm-iip1+1),1)+ip1jm-iip1+1)* 135 136 c & dyqv(ismin(iim,dyqv(ip1jm-iip1+1),1)+ip1jm-iip1+1).le.0.) 136 c & ap s=0.137 c & apps=0. 137 138 138 139 c limitation des pentes aux poles 139 140 c do ij=1,iip1 140 c dyq(ij)=ap n*dyq(ij)141 c dyq(ip1jm+ij)=ap s*dyq(ip1jm+ij)141 c dyq(ij)=appn*dyq(ij) 142 c dyq(ip1jm+ij)=apps*dyq(ip1jm+ij) 142 143 c enddo 143 144 -
LMDZ5/branches/testing/libf/dyn3dmem/logic.h
r1669 r1707 1 1 ! 2 ! $Id : logic.h 1319 2010-02-23 21:29:54Z fairhead$2 ! $Id$ 3 3 ! 4 4 ! 5 ! 5 ! NB: keep items of different kinds in seperate common blocs to avoid 6 ! "misaligned commons" issues 6 7 !----------------------------------------------------------------------- 7 8 ! INCLUDE 'logic.h' 8 9 9 COMMON/logic / purmats,iflag_phys,forward,leapf,apphys,&10 COMMON/logicl/ purmats,forward,leapf,apphys, & 10 11 & statcl,conser,apdiss,apdelq,saison,ecripar,fxyhypb,ysinus & 11 12 & ,read_start,ok_guide,ok_strato,ok_gradsfile & 12 & ,ok_limit,ok_etat0 13 & ,ok_limit,ok_etat0,grilles_gcm_netcdf,hybrid 13 14 15 COMMON/logici/ iflag_phys,iflag_trac 16 14 17 LOGICAL purmats,forward,leapf,apphys,statcl,conser, & 15 18 & apdiss,apdelq,saison,ecripar,fxyhypb,ysinus & 16 19 & ,read_start,ok_guide,ok_strato,ok_gradsfile & 17 & ,ok_limit,ok_etat0 20 & ,ok_limit,ok_etat0,grilles_gcm_netcdf 21 logical hybrid ! vertical coordinate is hybrid if true (sigma otherwise) 22 ! (only used if disvert_type==2) 18 23 19 INTEGER iflag_phys 20 !$OMP THREADPRIVATE(/logic/) 24 integer iflag_phys,iflag_trac 25 !$OMP THREADPRIVATE(/logicl/) 26 !$OMP THREADPRIVATE(/logici/) 21 27 !----------------------------------------------------------------------- -
LMDZ5/branches/testing/libf/dyn3dmem/mod_filtreg_p.F
r1669 r1707 210 210 IF( ifiltre.EQ.-2 ) THEN 211 211 DO j = jdfil,jffil 212 CALL DGEMM("N", "N", iim, nbniv_loc, iim, 1.0, 212 #ifdef BLAS 213 CALL SGEMM("N", "N", iim, nbniv_loc, iim, 1.0, 213 214 & matrinvn(1,1,j), iim, 214 215 & champ_loc(1,j,1), iip1*(jje-jjb+1), 0.0, 215 216 & champ_fft(1,j,1), iip1*(jje-jjb+1)) 217 #else 218 champ_fft(:,j,:)= 219 & matmul(matrinvn(:,:,j),champ_loc(:iim,j,:)) 220 #endif 216 221 ENDDO 217 222 218 223 ELSE IF ( griscal ) THEN 219 224 DO j = jdfil,jffil 220 CALL DGEMM("N", "N", iim, nbniv_loc, iim, 1.0, 225 #ifdef BLAS 226 CALL SGEMM("N", "N", iim, nbniv_loc, iim, 1.0, 221 227 & matriceun(1,1,j), iim, 222 228 & champ_loc(1,j,1), iip1*(jje-jjb+1), 0.0, 223 229 & champ_fft(1,j,1), iip1*(jje-jjb+1)) 230 #else 231 champ_fft(:,j,:)= 232 & matmul(matriceun(:,:,j),champ_loc(:iim,j,:)) 233 #endif 224 234 ENDDO 225 235 226 236 ELSE 227 237 DO j = jdfil,jffil 228 CALL DGEMM("N", "N", iim, nbniv_loc, iim, 1.0, 238 #ifdef BLAS 239 CALL SGEMM("N", "N", iim, nbniv_loc, iim, 1.0, 229 240 & matricevn(1,1,j), iim, 230 241 & champ_loc(1,j,1), iip1*(jje-jjb+1), 0.0, 231 242 & champ_fft(1,j,1), iip1*(jje-jjb+1)) 243 #else 244 champ_fft(:,j,:)= 245 & matmul(matricevn(:,:,j),champ_loc(:iim,j,:)) 246 #endif 232 247 ENDDO 233 248 … … 238 253 IF( ifiltre.EQ.-2 ) THEN 239 254 DO j = jdfil,jffil 240 CALL DGEMM("N", "N", iim, nbniv_loc, iim, 1.0, 255 #ifdef BLAS 256 CALL SGEMM("N", "N", iim, nbniv_loc, iim, 1.0, 241 257 & matrinvs(1,1,j-jfiltsu+1), iim, 242 258 & champ_loc(1,j,1), iip1*(jje-jjb+1), 0.0, 243 259 & champ_fft(1,j,1), iip1*(jje-jjb+1)) 260 #else 261 champ_fft(:,j,:)= 262 & matmul(matrinvs(:,:,j-jfiltsu+1), 263 & champ_loc(:iim,j,:)) 264 #endif 244 265 ENDDO 245 266 … … 247 268 248 269 DO j = jdfil,jffil 249 CALL DGEMM("N", "N", iim, nbniv_loc, iim, 1.0, 270 #ifdef BLAS 271 CALL SGEMM("N", "N", iim, nbniv_loc, iim, 1.0, 250 272 & matriceus(1,1,j-jfiltsu+1), iim, 251 273 & champ_loc(1,j,1), iip1*(jje-jjb+1), 0.0, 252 274 & champ_fft(1,j,1), iip1*(jje-jjb+1)) 275 #else 276 champ_fft(:,j,:)= 277 & matmul(matriceus(:,:,j-jfiltsu+1), 278 & champ_loc(:iim,j,:)) 279 #endif 253 280 ENDDO 254 281 … … 256 283 257 284 DO j = jdfil,jffil 258 CALL DGEMM("N", "N", iim, nbniv_loc, iim, 1.0, 285 #ifdef BLAS 286 CALL SGEMM("N", "N", iim, nbniv_loc, iim, 1.0, 259 287 & matricevs(1,1,j-jfiltsv+1), iim, 260 288 & champ_loc(1,j,1), iip1*(jje-jjb+1), 0.0, 261 289 & champ_fft(1,j,1), iip1*(jje-jjb+1)) 290 #else 291 champ_fft(:,j,:)= 292 & matmul(matricevs(:,:,j-jfiltsv+1), 293 & champ_loc(:iim,j,:)) 294 #endif 262 295 ENDDO 263 296 … … 269 302 270 303 c !-------------------------------------! 271 c ! D és-agregation des niveau verticaux !304 c ! Dés-agregation des niveau verticaux ! 272 305 c ! uniquement necessaire pour une ! 273 306 c ! execution OpenMP ! … … 402 435 END SUBROUTINE filtreg_p 403 436 END MODULE mod_filtreg_p 437 -
LMDZ5/branches/testing/libf/dyn3dmem/mod_interface_dyn_phys.F90
r1669 r1707 1 1 ! 2 ! $Id : mod_interface_dyn_phys.F90 1279 2009-12-10 09:02:56Z fairhead$2 ! $Id$ 3 3 ! 4 4 MODULE mod_interface_dyn_phys … … 7 7 8 8 9 #ifdef CPP_ EARTH9 #ifdef CPP_PHYS 10 10 ! Interface with parallel physics, 11 ! for now this routine only works with Earth physics12 11 CONTAINS 13 12 … … 56 55 END SUBROUTINE Init_interface_dyn_phys 57 56 #endif 58 ! of #ifdef CPP_ EARTH57 ! of #ifdef CPP_PHYS 59 58 END MODULE mod_interface_dyn_phys -
LMDZ5/branches/testing/libf/dyn3dmem/parallel.F90
r1669 r1707 1 1 ! 2 ! $Id : parallel.F90 1279 2009-12-10 09:02:56Z fairhead$2 ! $Id$ 3 3 ! 4 4 module parallel … … 94 94 integer, dimension(3) :: blocklen,type 95 95 integer :: comp_id 96 96 character(len=4) :: num 97 character(len=20) :: filename 98 97 99 #ifdef CPP_OMP 98 100 INTEGER :: OMP_GET_NUM_THREADS … … 126 128 mpi_rank=0 127 129 ENDIF 128 130 131 132 ! Open text output file with mpi_rank in suffix of file name 133 IF (lunout /= 5 .and. lunout /= 6) THEN 134 WRITE(num,'(I4.4)') mpi_rank 135 filename='lmdz.out_'//num 136 IF (mpi_rank .NE. 0) THEN 137 OPEN(UNIT=lunout,FILE=TRIM(filename),ACTION='write', & 138 STATUS='unknown',FORM='formatted',IOSTAT=ierr) 139 ENDIF 140 ENDIF 141 129 142 130 143 allocate(jj_begin_para(0:mpi_size-1)) … … 376 389 integer :: ierr 377 390 integer :: i 378 deallocate(jj_begin_para) 379 deallocate(jj_end_para) 380 deallocate(jj_nb_para) 391 392 if (allocated(jj_begin_para)) deallocate(jj_begin_para) 393 if (allocated(jj_end_para)) deallocate(jj_end_para) 394 if (allocated(jj_nb_para)) deallocate(jj_nb_para) 381 395 382 396 if (type_ocean == 'couple') then … … 643 657 enddo 644 658 645 endif 659 else 660 ! Ehouarn: When in debug mode, ifort complains (for call MPI_GATHERV 661 ! below) about Buffer_Recv() being not allocated. 662 ! So make a dummy allocation. 663 allocate(Buffer_Recv(1)) 664 endif ! of if (MPI_Rank==rank) 646 665 647 666 !$OMP CRITICAL (MPI) … … 717 736 718 737 719 /* 720 Subroutine verif_hallo(Field,ij,ll,up,down) 721 implicit none 722 #include "dimensions.h" 723 #include "paramet.h" 724 include 'mpif.h' 725 726 INTEGER :: ij,ll 727 REAL, dimension(ij,ll) :: Field 728 INTEGER :: up,down 729 730 REAL,dimension(ij,ll): NewField 731 732 NewField=0 733 734 ijb=ij_begin 735 ije=ij_end 736 if (pole_nord) 737 NewField(ij_be 738 */ 738 ! Subroutine verif_hallo(Field,ij,ll,up,down) 739 ! implicit none 740 !#include "dimensions.h" 741 !#include "paramet.h" 742 ! include 'mpif.h' 743 ! 744 ! INTEGER :: ij,ll 745 ! REAL, dimension(ij,ll) :: Field 746 ! INTEGER :: up,down 747 ! 748 ! REAL,dimension(ij,ll): NewField 749 ! 750 ! NewField=0 751 ! 752 ! ijb=ij_begin 753 ! ije=ij_end 754 ! if (pole_nord) 755 ! NewField(ij_be 756 739 757 end module parallel -
LMDZ5/branches/testing/libf/dyn3dmem/paramet.h
r1669 r1707 1 1 ! 2 ! $ Header$2 ! $Id$ 3 3 ! 4 4 ! -
LMDZ5/branches/testing/libf/dyn3dmem/temps.h
r1669 r1707 1 1 ! 2 ! $Id : temps.h 1279 2009-12-10 09:02:56Z fairhead$2 ! $Id$ 3 3 ! 4 4 ! ATTENTION!!!!: ce fichier include est compatible format fixe/format libre … … 14 14 15 15 COMMON/temps/itaufin, dt, day_ini, day_end, annee_ref, day_ref, & 16 & itau_dyn, itau_phy, jD_ref, jH_ref, calend 16 & itau_dyn, itau_phy, jD_ref, jH_ref, calend, & 17 & start_time 18 17 19 18 20 INTEGER itaufin 19 21 INTEGER itau_dyn, itau_phy 20 22 INTEGER day_ini, day_end, annee_ref, day_ref 21 REAL dt, jD_ref, jH_ref 23 REAL dt, jD_ref, jH_ref, start_time 22 24 CHARACTER (len=10) :: calend 23 25 -
LMDZ5/branches/testing/libf/dyn3dmem/vlsplt_loc.F
r1669 r1707 1 ! 2 ! $Id$ 3 ! 1 4 SUBROUTINE vlx_loc(q,pente_max,masse,u_m,ijb_x,ije_x) 2 5 … … 372 375 REAL qbyv(ijb_v:ije_v,llm) 373 376 374 REAL qpns,qpsn,ap n,aps,dyn1,dys1,dyn2,dys2,newmasse,fn,fs377 REAL qpns,qpsn,appn,apps,dyn1,dys1,dyn2,dys2,newmasse,fn,fs 375 378 c REAL newq,oldmasse 376 379 Logical extremum,first,testcpu … … 543 546 C PRINT*,dyq(1) 544 547 C PRINT*,dyqv(iip1+1) 545 C ap n=abs(dyq(1)/dyqv(iip1+1))548 C appn=abs(dyq(1)/dyqv(iip1+1)) 546 549 C PRINT*,dyq(ip1jm+1) 547 550 C PRINT*,dyqv(ip1jm-iip1+1) 548 C ap s=abs(dyq(ip1jm+1)/dyqv(ip1jm-iip1+1))551 C apps=abs(dyq(ip1jm+1)/dyqv(ip1jm-iip1+1)) 549 552 C DO ij=2,iim 550 C ap n=amax1(abs(dyq(ij)/dyqv(ij)),apn)551 C ap s=amax1(abs(dyq(ip1jm+ij)/dyqv(ip1jm-iip1+ij)),aps)553 C appn=amax1(abs(dyq(ij)/dyqv(ij)),appn) 554 C apps=amax1(abs(dyq(ip1jm+ij)/dyqv(ip1jm-iip1+ij)),apps) 552 555 C ENDDO 553 C ap n=min(pente_max/apn,1.)554 C ap s=min(pente_max/aps,1.)556 C appn=min(pente_max/appn,1.) 557 C apps=min(pente_max/apps,1.) 555 558 C 556 559 C … … 558 561 C 559 562 C IF(dyqv(ismin(iim,dyqv,1))*dyqv(ismax(iim,dyqv,1)).le.0.) 560 C & ap n=0.563 C & appn=0. 561 564 C IF(dyqv(ismax(iim,dyqv(ip1jm-iip1+1),1)+ip1jm-iip1+1)* 562 565 C & dyqv(ismin(iim,dyqv(ip1jm-iip1+1),1)+ip1jm-iip1+1).le.0.) 563 C & ap s=0.566 C & apps=0. 564 567 C 565 568 C limitation des pentes aux poles 566 569 C DO ij=1,iip1 567 C dyq(ij)=ap n*dyq(ij)568 C dyq(ip1jm+ij)=ap s*dyq(ip1jm+ij)570 C dyq(ij)=appn*dyq(ij) 571 C dyq(ip1jm+ij)=apps*dyq(ip1jm+ij) 569 572 C ENDDO 570 573 C -
LMDZ5/branches/testing/libf/dyn3dmem/vlspltqs_loc.F
r1669 r1707 549 549 C PRINT*,dyq(1) 550 550 C PRINT*,dyqv(iip1+1) 551 C ap n=abs(dyq(1)/dyqv(iip1+1))551 C appn=abs(dyq(1)/dyqv(iip1+1)) 552 552 C PRINT*,dyq(ip1jm+1) 553 553 C PRINT*,dyqv(ip1jm-iip1+1) 554 C ap s=abs(dyq(ip1jm+1)/dyqv(ip1jm-iip1+1))554 C apps=abs(dyq(ip1jm+1)/dyqv(ip1jm-iip1+1)) 555 555 C DO ij=2,iim 556 C ap n=amax1(abs(dyq(ij)/dyqv(ij)),apn)557 C ap s=amax1(abs(dyq(ip1jm+ij)/dyqv(ip1jm-iip1+ij)),aps)556 C appn=amax1(abs(dyq(ij)/dyqv(ij)),appn) 557 C apps=amax1(abs(dyq(ip1jm+ij)/dyqv(ip1jm-iip1+ij)),apps) 558 558 C ENDDO 559 C ap n=min(pente_max/apn,1.)560 C ap s=min(pente_max/aps,1.)559 C appn=min(pente_max/appn,1.) 560 C apps=min(pente_max/apps,1.) 561 561 C 562 562 C … … 564 564 C 565 565 C IF(dyqv(ismin(iim,dyqv,1))*dyqv(ismax(iim,dyqv,1)).le.0.) 566 C & ap n=0.566 C & appn=0. 567 567 C IF(dyqv(ismax(iim,dyqv(ip1jm-iip1+1),1)+ip1jm-iip1+1)* 568 568 C & dyqv(ismin(iim,dyqv(ip1jm-iip1+1),1)+ip1jm-iip1+1).le.0.) 569 C & ap s=0.569 C & apps=0. 570 570 C 571 571 C limitation des pentes aux poles 572 572 C DO ij=1,iip1 573 C dyq(ij)=ap n*dyq(ij)574 C dyq(ip1jm+ij)=ap s*dyq(ip1jm+ij)573 C dyq(ij)=appn*dyq(ij) 574 C dyq(ip1jm+ij)=apps*dyq(ip1jm+ij) 575 575 C ENDDO 576 576 C -
LMDZ5/branches/testing/libf/dyn3dmem/wrgrads.F
r1669 r1707 22 22 c local 23 23 24 integer im,jm,lm,i,j,l, lnblnk,iv,iii,iji,iif,ijf24 integer im,jm,lm,i,j,l,iv,iii,iji,iif,ijf 25 25 26 26 logical writectl … … 55 55 nvar(if)=ivar(if) 56 56 var(ivar(if),if)=name 57 tvar(ivar(if),if)=t itlevar(1:lnblnk(titlevar))57 tvar(ivar(if),if)=trim(titlevar) 58 58 nld(ivar(if),if)=nl 59 59 print*,'initialisation ecriture de ',var(ivar(if),if) … … 96 96 file=fichier(if) 97 97 c WARNING! on reecrase le fichier .ctl a chaque ecriture 98 open(unit(if),file= file(1:lnblnk(file))//'.ctl'98 open(unit(if),file=trim(file)//'.ctl' 99 99 & ,form='formatted',status='unknown') 100 100 write(unit(if),'(a5,1x,a40)') 101 & 'DSET ','^'// file(1:lnblnk(file))//'.dat'101 & 'DSET ','^'//trim(file)//'.dat' 102 102 103 103 write(unit(if),'(a12)') 'UNDEF 1.0E30' -
LMDZ5/branches/testing/libf/dyn3dpar/calfis_p.F
r1669 r1707 684 684 . debut_split, !! firstcall 685 685 . lafin_split, !! lastcall 686 . float(day_ini), !! pday <-- day_ini (dans temps.h)686 . jD_cur, !! pday. see leapfrog_p 687 687 . jH_cur_split, !! ptime "fraction of day" 688 688 . zdt_split, !! ptimestep -
LMDZ5/branches/testing/libf/dyn3dpar/comconst.h
r1505 r1707 21 21 REAL dtdiss ! (s) time step for the dissipation 22 22 REAL rad ! (m) radius of the planet 23 REAL r ! Gas constant R=8.31 J.K-1.mol-1 24 REAL cpp ! Cp 23 REAL r ! Reduced Gas constant r=R/mu 24 ! with R=8.31.. J.K-1.mol-1, mu: mol mass of atmosphere (kg/mol) 25 REAL cpp ! Specific heat Cp (J.kg-1.K-1) 25 26 REAL kappa ! kappa=R/Cp 26 27 REAL cotot -
LMDZ5/branches/testing/libf/dyn3dpar/comdissnew.h
r1319 r1707 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 integer vert_prof_dissip ! vertical profile of horizontal dissipation 20 ! Allowed values: 21 ! 0: rational fraction, function of pressure 22 ! 1: tanh of altitude 23 18 24 REAL tetagdiv, tetagrot, tetatemp, coefdis 19 25 -
LMDZ5/branches/testing/libf/dyn3dpar/conf_gcm.F
r1665 r1707 6 6 SUBROUTINE conf_gcm( tapedef, etatinit, clesphy0 ) 7 7 c 8 USE control_mod 8 9 #ifdef CPP_IOIPSL 9 10 use IOIPSL … … 16 17 use mod_hallo, ONLY : use_mpi_alloc 17 18 use parallel, ONLY : omp_chunk 18 USE control_mod19 19 USE infotrac, ONLY : type_trac 20 use assert_m, only: assert 21 20 22 IMPLICIT NONE 21 23 c----------------------------------------------------------------------- … … 43 45 #include "serre.h" 44 46 #include "comdissnew.h" 45 !#include "clesphys.h"46 #include "iniprint.h"47 47 #include "temps.h" 48 48 #include "comconst.h" 49 49 50 50 ! FH 2008/05/09 On elimine toutes les clefs physiques dans la dynamique 51 ! #include "clesphys.h" 52 #include "iniprint.h" 51 53 c 52 54 c … … 105 107 OPEN(UNIT=lunout,FILE='lmdz.out_0000',ACTION='write', 106 108 & STATUS='unknown',FORM='formatted') 107 108 109 ENDIF 109 110 … … 185 186 186 187 !Config Key = nsplit_phys 187 !Config Desc = nombre d'iteration de la physique188 !Config Def = 240189 !Config Help = nombre d'itration de la physique190 !191 188 nsplit_phys = 1 192 189 CALL getin('nsplit_phys',nsplit_phys) … … 325 322 CALL getin('tau_top_bound',tau_top_bound) 326 323 327 !328 324 !Config Key = coefdis 329 325 !Config Desc = coefficient pour gamdissip … … 608 604 type_trac = 'lmdz' 609 605 CALL getin('type_trac',type_trac) 610 611 606 612 607 !Config Key = config_inca … … 830 825 831 826 !Config Key = ok_dynzon 832 !Config Desc = calcul et sortie des transports827 !Config Desc = sortie des transports zonaux dans la dynamique 833 828 !Config Def = n 834 829 !Config Help = Permet de mettre en route le calcul des transports … … 865 860 write(lunout,*)"Le zoom en longitude est incompatible", 866 861 & " avec l'utilisation du filtre FFT ", 867 & "---> filtre FFT désactivé"862 & "---> FFT filter not active" 868 863 use_filtre_fft=.FALSE. 869 864 ENDIF … … 898 893 ok_strato=.FALSE. 899 894 CALL getin('ok_strato',ok_strato) 895 896 vert_prof_dissip = merge(1, 0, ok_strato .and. llm==39) 897 CALL getin('vert_prof_dissip', vert_prof_dissip) 898 call assert(vert_prof_dissip == 0 .or. vert_prof_dissip == 1, 899 $ "bad value for vert_prof_dissip") 900 900 901 901 !Config Key = ok_gradsfile … … 968 968 write(lunout,*)' type_trac = ', type_trac 969 969 write(lunout,*)' config_inca = ', config_inca 970 write(lunout,*)' ok_dynzon = ', ok_dynzon 970 write(lunout,*)' ok_dynzon = ', ok_dynzon 971 971 write(lunout,*)' ok_dyn_ins = ', ok_dyn_ins 972 972 write(lunout,*)' ok_dyn_ave = ', ok_dyn_ave -
LMDZ5/branches/testing/libf/dyn3dpar/filtreg_p.F
r1665 r1707 214 214 & champ_fft(1,j-jdfil+1,1), iip1*nlat) 215 215 #else 216 champ_fft(: ,j-jdfil+1,:)216 champ_fft(:iim,j-jdfil+1,:) 217 217 & =matmul(matrinvn(:,:,j),champ_loc(:iim,j,:)) 218 218 #endif … … 227 227 & champ_fft(1,j-jdfil+1,1), iip1*nlat) 228 228 #else 229 champ_fft(: ,j-jdfil+1,:)229 champ_fft(:iim,j-jdfil+1,:) 230 230 & =matmul(matriceun(:,:,j),champ_loc(:iim,j,:)) 231 231 #endif … … 240 240 & champ_fft(1,j-jdfil+1,1), iip1*nlat) 241 241 #else 242 champ_fft(: ,j-jdfil+1,:)242 champ_fft(:iim,j-jdfil+1,:) 243 243 & =matmul(matricevn(:,:,j),champ_loc(:iim,j,:)) 244 244 #endif … … 257 257 & champ_fft(1,j-jdfil+1,1), iip1*nlat) 258 258 #else 259 champ_fft(: ,j-jdfil+1,:)259 champ_fft(:iim,j-jdfil+1,:) 260 260 & =matmul(matrinvs(:,:,j-jfiltsu+1), 261 261 & champ_loc(:iim,j,:)) … … 272 272 & champ_fft(1,j-jdfil+1,1), iip1*nlat) 273 273 #else 274 champ_fft(: ,j-jdfil+1,:)274 champ_fft(:iim,j-jdfil+1,:) 275 275 & =matmul(matriceus(:,:,j-jfiltsu+1), 276 276 & champ_loc(:iim,j,:)) … … 287 287 & champ_fft(1,j-jdfil+1,1), iip1*nlat) 288 288 #else 289 champ_fft(: ,j-jdfil+1,:)289 champ_fft(:iim,j-jdfil+1,:) 290 290 & =matmul(matricevs(:,:,j-jfiltsv+1), 291 291 & champ_loc(:iim,j,:)) -
LMDZ5/branches/testing/libf/dyn3dpar/fxhyp.F
r1403 r1707 48 48 c 49 49 REAL dzoom 50 REAL *8xlon(iip1),xprimm(iip1),xuv51 REAL *8xtild(0:nmax2)52 REAL *8fhyp(0:nmax2),ffdx,beta,Xprimt(0:nmax2)53 REAL *8Xf(0:nmax2),xxpr(0:nmax2)54 REAL *8xvrai(iip1),xxprim(iip1)55 REAL *8pi,depi,epsilon,xzoom,fa,fb56 REAL *8Xf1, Xfi , a0,a1,a2,a3,xi250 REAL(KIND=8) xlon(iip1),xprimm(iip1),xuv 51 REAL(KIND=8) xtild(0:nmax2) 52 REAL(KIND=8) fhyp(0:nmax2),ffdx,beta,Xprimt(0:nmax2) 53 REAL(KIND=8) Xf(0:nmax2),xxpr(0:nmax2) 54 REAL(KIND=8) xvrai(iip1),xxprim(iip1) 55 REAL(KIND=8) pi,depi,epsilon,xzoom,fa,fb 56 REAL(KIND=8) Xf1, Xfi , a0,a1,a2,a3,xi2 57 57 INTEGER i,it,ik,iter,ii,idif,ii1,ii2 58 REAL *8xi,xo1,xmoy,xlon2,fxm,Xprimin59 REAL *8champmin,champmax,decalx58 REAL(KIND=8) xi,xo1,xmoy,xlon2,fxm,Xprimin 59 REAL(KIND=8) champmin,champmax,decalx 60 60 INTEGER is2 61 61 SAVE is2 62 62 63 REAL *8heavyside63 REAL(KIND=8) heavyside 64 64 65 65 pi = 2. * ASIN(1.) … … 68 68 xzoom = xzoomdeg * pi/180. 69 69 c 70 if (iim==1) then 71 72 print*,'Longitudes calculees a la main pour iim=1' 73 74 rlonm025(1)=-pi/2. 75 rlonv(1)=0. 76 rlonu(1)=pi 77 rlonp025(1)=pi/2. 78 rlonm025(2)=rlonm025(1)+depi 79 rlonv(2)=rlonv(1)+depi 80 rlonu(2)=rlonu(1)+depi 81 rlonp025(2)=rlonp025(1)+depi 82 83 xprimm025(:)=1. 84 xprimv(:)=1. 85 xprimu(:)=1. 86 xprimp025(:)=1. 87 champmin=depi 88 champmax=depi 89 return 90 91 endif 92 70 93 decalx = .75 71 94 IF( grossism.EQ.1..AND.scal180 ) THEN … … 286 309 287 310 311 288 312 IF(ik.EQ.1.and.grossism.EQ.1.) THEN 289 313 xvrai(1) = xvrai(iip1)-depi 290 314 xxprim(1) = xxprim(iip1) 291 315 ENDIF 316 292 317 DO i = 1 , iim 293 318 xlon(i) = xvrai(i) -
LMDZ5/branches/testing/libf/dyn3dpar/gcm.F
r1665 r1707 418 418 419 419 CALL inidissip( lstardis, nitergdiv, nitergrot, niterh , 420 * tetagdiv, tetagrot , tetatemp 420 * tetagdiv, tetagrot , tetatemp, vert_prof_dissip) 421 421 422 422 c----------------------------------------------------------------------- 423 423 c Initialisation de la physique : 424 424 c ------------------------------- 425 IF (call_iniphys.and. iflag_phys.eq.1) THEN425 IF (call_iniphys.and.(iflag_phys==1.or.iflag_phys>=100)) THEN 426 426 latfi(1)=rlatu(1) 427 427 lonfi(1)=0. … … 446 446 ! Physics: 447 447 #ifdef CPP_PHYS 448 CALL iniphysiq(ngridmx,llm,daysec,day_ini,dtphys/nsplit_phys , 449 , latfi,lonfi,airefi,zcufi,zcvfi,rad,g,r,cpp ) 448 CALL iniphysiq(ngridmx,llm,daysec,day_ini,dtphys/nsplit_phys, 449 & latfi,lonfi,airefi,zcufi,zcvfi,rad,g,r,cpp, 450 & iflag_phys) 450 451 #endif 451 452 call_iniphys=.false. 452 ENDIF ! of IF (call_iniphys.and.(iflag_phys .eq.1))453 ENDIF ! of IF (call_iniphys.and.(iflag_phys==1.or.iflag_phys>=100)) 453 454 454 455 … … 481 482 301 FORMAT('1'/,15x,'run du ', i2,'/',i2,'/',i4) 482 483 302 FORMAT('1'/,15x,' au ', i2,'/',i2,'/',i4) 483 #endif484 485 #ifdef CPP_PHYS486 ! Create start file (startphy.nc) and boundary conditions (limit.nc)487 ! for the Earth verstion488 if (iflag_phys>=100) then489 call iniaqua(ngridmx,latfi,lonfi,iflag_phys)490 endif491 484 #endif 492 485 -
LMDZ5/branches/testing/libf/dyn3dpar/groupe_p.F
r764 r1707 37 37 integer i,j,l 38 38 39 logical firstcall 40 save firstcall 41 c$OMP THREADPRIVATE(firstcall )39 logical firstcall,groupe_ok 40 save firstcall,groupe_ok 41 c$OMP THREADPRIVATE(firstcall,groupe_ok) 42 42 43 43 data firstcall/.true./ 44 data groupe_ok/.true./ 45 44 46 integer ijb,ije,jjb,jje 45 47 48 if (iim==1) then 49 groupe_ok=.false. 50 endif 51 46 52 if (firstcall) then 47 if(mod(iim,2**ngroup).ne.0) stop'probleme du nombre ede point' 53 if (groupe_ok) then 54 if(mod(iim,2**ngroup).ne.0) stop'probleme du nombre de point' 55 endif 48 56 firstcall=.false. 49 57 endif … … 66 74 c$OMP END DO NOWAIT 67 75 68 call groupeun_p(jjp1,llm,jjb,jje,zconvmm) 76 if (groupe_ok) then 77 call groupeun_p(jjp1,llm,jjb,jje,zconvmm) 78 endif 69 79 70 80 jjb=jj_begin-1 … … 78 88 c$OMP END DO NOWAIT 79 89 80 call groupeun_p(jjm,llm,jjb,jje,pbarvm) 90 if (groupe_ok) then 91 call groupeun_p(jjm,llm,jjb,jje,pbarvm) 92 endif 81 93 82 94 c Champs 3D … … 101 113 enddo 102 114 c$OMP END DO NOWAIT 115 103 116 c integration de la convergence de masse de haut en bas ...... 104 117 -
LMDZ5/branches/testing/libf/dyn3dpar/inidissip.F90
r1665 r1707 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 … … 25 25 INTEGER,INTENT(in) :: nitergdiv,nitergrot,niterh 26 26 REAL,INTENT(in) :: tetagdiv,tetagrot,tetatemp 27 28 integer, INTENT(in):: vert_prof_dissip 29 ! Vertical profile of horizontal dissipation 30 ! Allowed values: 31 ! 0: rational fraction, function of pressure 32 ! 1: tanh of altitude 27 33 28 34 ! Local variables: … … 167 173 ! -------------------------------------------------- 168 174 169 if ( ok_strato .and. llm==39) then175 if (vert_prof_dissip == 1) then 170 176 do l=1,llm 171 177 pseudoz=8.*log(preff/presnivs(l)) -
LMDZ5/branches/testing/libf/dyn3dpar/leapfrog_p.F
r1665 r1707 139 139 REAL :: secondes 140 140 141 logical :: physic 141 142 LOGICAL first,callinigrads 142 143 … … 208 209 209 210 itau = 0 211 physic=.true. 212 if (iflag_phys==0.or.iflag_phys==2) physic=.false. 210 213 ! iday = day_ini+itau/day_step 211 214 ! time = REAL(itau-(iday-day_ini)*day_step)/day_step+time_0 … … 364 367 s apdiss = .TRUE. 365 368 IF( MOD(itau,iphysiq ).EQ.0.AND..NOT.forward 366 s .and. iflag_phys.EQ.1) apphys = .TRUE.369 s .and. physic ) apphys = .TRUE. 367 370 ELSE 368 371 ! Leapfrog/Matsuno time stepping … … 370 373 IF( MOD(itau+1,dissip_period).EQ.0 .AND. .NOT. forward ) 371 374 s apdiss = .TRUE. 372 IF( MOD(itau+1,iphysiq).EQ.0.AND. iflag_phys.EQ.1) apphys=.TRUE.375 IF( MOD(itau+1,iphysiq).EQ.0.AND.physic) apphys=.TRUE. 373 376 END IF 374 377 … … 707 710 jD_cur = jD_ref + day_ini - day_ref 708 711 $ + itau/day_step 712 713 IF (planet_type .eq."generic") THEN 714 ! AS: we make jD_cur to be pday 715 jD_cur = int(day_ini + itau/day_step) 716 ENDIF 717 709 718 jH_cur = jH_ref + start_time + & 710 719 & mod(itau,day_step)/float(day_step) -
LMDZ5/branches/testing/libf/dyn3dpar/parallel.F90
r1664 r1707 489 489 enddo 490 490 491 endif 491 else 492 ! Ehouarn: When in debug mode, ifort complains (for call MPI_GATHERV 493 ! below) about Buffer_Recv() being not allocated. 494 ! So make a dummy allocation. 495 allocate(Buffer_Recv(1)) 496 endif ! of if (MPI_Rank==rank) 492 497 493 498 !$OMP CRITICAL (MPI) -
LMDZ5/branches/testing/libf/dyn3dpar/paramet.h
r792 r1707 17 17 INTEGER jcfil,jcfllm 18 18 19 PARAMETER( iip1= iim+1 -1/iim,iip2=iim+2,iip3=iim+3&19 PARAMETER( iip1= iim+1,iip2=iim+2,iip3=iim+3 & 20 20 & ,jjp1=jjm+1-1/jjm) 21 21 PARAMETER( llmp1 = llm+1, llmp2 = llm+2, llmm1 = llm-1 ) -
LMDZ5/branches/testing/libf/filtrez/filtreg.F
r1279 r1707 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, -
LMDZ5/branches/testing/libf/filtrez/filtreg_mod.F90
r1665 r1707 1 1 ! 2 ! $Id 2 ! $Id$ 3 3 ! 4 4 MODULE filtreg_mod … … 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 -
LMDZ5/branches/testing/libf/filtrez/mod_fft.F90
r986 r1707 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 -
LMDZ5/branches/testing/libf/phy1d/1DUTILS.h_no_writelim
r1665 r1707 52 52 !Config (defaut sortie standard = 6) 53 53 lunout=6 54 CALL getin('lunout', lunout)54 ! CALL getin('lunout', lunout) 55 55 IF (lunout /= 5 .and. lunout /= 6) THEN 56 56 OPEN(lunout,FILE='lmdz.out') -
LMDZ5/branches/testing/libf/phy1d/1DUTILS.h_with_writelim
r1665 r1707 52 52 !Config (defaut sortie standard = 6) 53 53 lunout=6 54 CALL getin('lunout', lunout)54 ! CALL getin('lunout', lunout) 55 55 IF (lunout /= 5 .and. lunout /= 6) THEN 56 56 OPEN(lunout,FILE='lmdz.out') -
LMDZ5/branches/testing/libf/phy1d/1DUTILS.h_with_writelim_old
r1665 r1707 52 52 !Config (defaut sortie standard = 6) 53 53 lunout=6 54 CALL getin('lunout', lunout)54 ! CALL getin('lunout', lunout) 55 55 IF (lunout /= 5 .and. lunout /= 6) THEN 56 56 OPEN(lunout,FILE='lmdz.out') -
LMDZ5/branches/testing/libf/phy1d/lmdz1d.F
r1669 r1707 711 711 !--------------------------------------------------------------------- 712 712 713 fcoriolis=2.*sin(rpi* rlat(1)/180.)*romega713 fcoriolis=2.*sin(rpi*xlat/180.)*romega 714 714 715 715 if (forcing_radconv) then -
LMDZ5/branches/testing/libf/phydev/iniphysiq.F
r1665 r1707 2 2 ! $Id: iniphysiq.F 1403 2010-07-01 09:02:53Z fairhead $ 3 3 ! 4 c5 c6 4 SUBROUTINE iniphysiq(ngrid,nlayer, 7 5 $ punjours, 8 6 $ pdayref,ptimestep, 9 7 $ plat,plon,parea,pcu,pcv, 10 $ prad,pg,pr,pcpp) 11 USE dimphy 12 USE mod_grid_phy_lmdz 13 USE mod_phys_lmdz_para 14 USE comgeomphy 8 $ prad,pg,pr,pcpp,iflag_phys) 9 USE dimphy, only : klev 10 USE mod_grid_phy_lmdz, only : klon_glo 11 USE mod_phys_lmdz_para, only : klon_omp,klon_omp_begin, 12 & klon_omp_end,klon_mpi_begin 13 USE comgeomphy, only : airephy,cuphy,cvphy,rlond,rlatd 14 USE comcstphy, only : rradius,rg,rr,rcpp 15 15 16 16 IMPLICIT NONE … … 18 18 c======================================================================= 19 19 c 20 c subject:21 c --------20 c Initialisation of the physical constants and some positional and 21 c geometrical arrays for the physics 22 22 c 23 c Initialisation for the physical parametrisations of the LMD24 c martian atmospheric general circulation modele.25 c26 c author: Frederic Hourdin 15 / 10 /9327 c -------28 c29 c arguments:30 c ----------31 c32 c input:33 c ------34 23 c 35 24 c ngrid Size of the horizontal grid. … … 37 26 c nlayer Number of vertical layers. 38 27 c pdayref Day of reference for the simulation 39 c firstcall True at the first call40 c lastcall True at the last call41 c pday Number of days counted from the North. Spring42 c equinoxe.43 28 c 44 29 c======================================================================= 45 c 46 c----------------------------------------------------------------------- 47 c declarations: 48 c ------------- 30 49 31 50 32 cym#include "dimensions.h" 51 33 cym#include "dimphy.h" 52 34 cym#include "comgeomphy.h" 53 #include "comcstphy.h" 54 REAL prad,pg,pr,pcpp,punjours 55 56 INTEGER ngrid,nlayer 57 REAL plat(ngrid),plon(ngrid),parea(klon_glo) 58 REAL pcu(klon_glo),pcv(klon_glo) 59 INTEGER pdayref 35 #include "iniprint.h" 36 37 REAL,INTENT(IN) :: prad ! radius of the planet (m) 38 REAL,INTENT(IN) :: pg ! gravitational acceleration (m/s2) 39 REAL,INTENT(IN) :: pr ! ! reduced gas constant R/mu 40 REAL,INTENT(IN) :: pcpp ! specific heat Cp 41 REAL,INTENT(IN) :: punjours ! length (in s) of a standard day 42 INTEGER,INTENT(IN) :: ngrid ! number of horizontal grid points in the physics 43 INTEGER,INTENT(IN) :: nlayer ! number of atmospheric layers 44 REAL,INTENT(IN) :: plat(ngrid) ! latitudes of the physics grid 45 REAL,INTENT(IN) :: plon(ngrid) ! longitudes of the physics grid 46 REAL,INTENT(IN) :: parea(klon_glo) ! area (m2) 47 REAL,INTENT(IN) :: pcu(klon_glo) ! cu coeff. (u_covariant = cu * u) 48 REAL,INTENT(IN) :: pcv(klon_glo) ! cv coeff. (v_covariant = cv * v) 49 INTEGER,INTENT(IN) :: pdayref ! reference day of for the simulation 50 REAL,INTENT(IN) :: ptimestep !physics time step (s) 51 INTEGER,INTENT(IN) :: iflag_phys ! type of physics to be called 52 60 53 INTEGER :: ibegin,iend,offset 61 62 REAL ptimestep63 54 CHARACTER (LEN=20) :: modname='iniphysiq' 64 55 CHARACTER (LEN=80) :: abort_message 65 56 66 57 IF (nlayer.NE.klev) THEN 67 PRINT*,'STOP in inifis'68 PRINT*,'Probleme dedimensions :'69 PRINT*,'nlayer = ',nlayer70 PRINT*,'klev = ',klev58 write(lunout,*) 'STOP in ',trim(modname) 59 write(lunout,*) 'Problem with dimensions :' 60 write(lunout,*) 'nlayer = ',nlayer 61 write(lunout,*) 'klev = ',klev 71 62 abort_message = '' 72 63 CALL abort_gcm (modname,abort_message,1) … … 74 65 75 66 IF (ngrid.NE.klon_glo) THEN 76 PRINT*,'STOP in inifis'77 PRINT*,'Probleme dedimensions :'78 PRINT*,'ngrid = ',ngrid79 PRINT*,'klon = ',klon_glo67 write(lunout,*) 'STOP in ',trim(modname) 68 write(lunout,*) 'Problem with dimensions :' 69 write(lunout,*) 'ngrid = ',ngrid 70 write(lunout,*) 'klon = ',klon_glo 80 71 abort_message = '' 81 72 CALL abort_gcm (modname,abort_message,1) 82 73 ENDIF 83 c$OMP PARALLEL PRIVATE(ibegin,iend) 84 c$OMP+ SHARED(parea,pcu,pcv,plon,plat) 74 75 !$OMP PARALLEL PRIVATE(ibegin,iend) 76 !$OMP+ SHARED(parea,pcu,pcv,plon,plat) 85 77 86 78 offset=klon_mpi_begin-1 … … 92 84 rlatd(1:klon_omp)=plat(offset+klon_omp_begin:offset+klon_omp_end) 93 85 94 ! call suphel 95 ! prad,pg,pr,pcpp 86 ! copy some fundamental parameters to physics 96 87 rradius=prad 97 88 rg=pg … … 99 90 rcpp=pcpp 100 91 101 92 !$OMP END PARALLEL 102 93 103 c$OMP END PARALLEL 94 ! print*,'ATTENTION !!! TRAVAILLER SUR INIPHYSIQ' 95 ! print*,'CONTROLE DES LATITUDES, LONGITUDES, PARAMETRES ...' 104 96 105 print*,'ATTENTION !!! TRAVAILLER SUR INIPHYSIQ' 106 print*,'CONTROLE DES LATITUDES, LONGITUDES, PARAMETRES ...' 97 ! Additional initializations for aquaplanets 98 !$OMP PARALLEL 99 if (iflag_phys>=100) then 100 call iniaqua(klon_omp,rlatd,rlond,iflag_phys) 101 endif 102 !$OMP END PARALLEL 107 103 108 RETURN109 9999 CONTINUE110 abort_message ='Cette version demande les fichier rnatur.dat111 & et surf.def'112 CALL abort_gcm (modname,abort_message,1)104 ! RETURN 105 !9999 CONTINUE 106 ! abort_message ='Cette version demande les fichier rnatur.dat 107 ! & et surf.def' 108 ! CALL abort_gcm (modname,abort_message,1) 113 109 114 110 END -
LMDZ5/branches/testing/libf/phydev/phyaqua.F
r1665 r1707 1 ! Routines complementaires pour la physique planetaire. 2 1 ! 2 ! $Id: $ 3 ! 3 4 4 5 subroutine iniaqua(nlon,latfi,lonfi,iflag_phys) 5 6 6 7 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 7 ! Creation d'un etat initial et de conditions aux limites 8 ! (resp startphy.nc et limit.nc) pour des configurations idealisees 9 ! du modele LMDZ dans sa version terrestre. 10 ! iflag_phys est un parametre qui controle 11 ! iflag_phys = N 12 ! de 100 a 199 : aqua planetes avec SST forcees 13 ! N-100 determine le type de SSTs 14 ! de 200 a 299 : terra planetes avec Ts calcule 15 ! 8 ! Create an initial state (startphy.nc) for the physics 9 ! Usefull for idealised cases (e.g. aquaplanets or testcases) 16 10 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 17 11 12 use phys_state_var_mod, only : rlat,rlon, 13 & phys_state_var_init 14 use mod_phys_lmdz_para, only : klon_omp 15 use comgeomphy, only : rlond,rlatd 16 implicit none 17 18 integer,intent(in) :: nlon,iflag_phys 19 real,intent(in) :: lonfi(nlon),latfi(nlon) 18 20 19 integer nlon,iflag_phys 20 cIM ajout latfi, lonfi 21 REAL, DIMENSION (nlon) :: lonfi, latfi 21 ! local variables 22 real :: pi 23 24 ! initializations: 25 pi=2.*asin(1.) 26 27 call phys_state_var_init() 28 29 rlat(1:klon_omp)=rlatd(1:klon_omp)*180./pi 30 rlon(1:klon_omp)=rlond(1:klon_omp)*180./pi 22 31 23 32 24 return 33 ! Here you could create an initial condition for the physics 34 ! ... 35 ! ... fill in the fields... 36 ! ... 37 ! ... and create a "startphy.nc" file 38 CALL phyredem ("startphy.nc") 39 25 40 end 26 41 -
LMDZ5/branches/testing/libf/phydev/physiq.F90
r1665 r1707 11 11 & , PVteta) 12 12 13 USE dimphy 14 USE infotrac 15 USE comgeomphy 13 USE dimphy, only : klon,klev 14 USE infotrac, only : nqtot 15 USE comgeomphy, only : rlatd 16 USE comcstphy, only : rg 17 USE iophy, only : histbeg_phy,histwrite_phy 18 USE ioipsl, only : getin,histvert,histdef,histend,ymds2ju 19 USE mod_phys_lmdz_para, only : jj_nb 20 USE phys_state_var_mod, only : phys_state_var_init 16 21 17 22 IMPLICIT none 18 !====================================================================== 19 ! Objet: Moniteur general de la physique du modele 20 !====================================================================== 23 #include "dimensions.h" 24 25 integer,parameter :: jjmp1=jjm+1-1/jjm 26 integer,parameter :: iip1=iim+1 21 27 ! 22 ! Arguments:28 ! Routine argument: 23 29 ! 24 ! nlon----input-I-nombre de points horizontaux 25 ! nlev----input-I-nombre de couches verticales, doit etre egale a klev 26 ! debut---input-L-variable logique indiquant le premier passage 27 ! lafin---input-L-variable logique indiquant le dernier passage 28 ! jD_cur -R-jour courant a l'appel de la physique (jour julien) 29 ! jH_cur -R-heure courante a l'appel de la physique (jour julien) 30 ! pdtphys-input-R-pas d'integration pour la physique (seconde)31 ! paprs---input-R-pression pour chaque inter-couche (enPa)32 ! pplay---input-R-pression pour le mileu de chaque couche (enPa)33 ! pphi----input-R-geopotentiel de chaque couche (g z) (reference sol) 34 ! pphis---input-R-geopotentiel du sol35 ! presnivs-input_R_pressions approximat. des milieux couches ( en PA) 36 ! u-------input-R-vitesse dans la direction X (de O a E) en m/s 37 ! v-------input-R-vitesse Y (de S a N) en m/s 38 ! t-------input-R-temperature (K)39 ! qx------input-R-humidite specifique (kg/kg) et d'autres traceurs 40 ! d_t_dyn-input-R-tendance dynamique pour "t" (K/s)41 ! d_q_dyn-input-R-tendance dynamique pour "q" (kg/kg/s)42 ! flxmass_w -input-R- flux de masse verticale 43 ! d_u-----output-R-tendance physique de "u"(m/s/s)44 ! d_v-----output-R-tendance physique de "v"(m/s/s)45 ! d_t-----output-R-tendance physique de "t"(K/s)46 ! d_qx----output-R-tendance physique de "qx" (kg/kg/s) 47 ! d_ps----output-R-tendance physique de la pression au sol 48 !IM 49 ! PVteta--output-R-vorticite potentielle a des thetas constantes50 ! ======================================================================51 #include "dimensions.h" 52 #include "comcstphy.h" 30 integer,intent(in) :: nlon ! number of atmospheric colums 31 integer,intent(in) :: nlev ! number of vertical levels (should be =klev) 32 real,intent(in) :: jD_cur ! current day number (Julian day) 33 real,intent(in) :: jH_cur ! current time of day (as fraction of day) 34 logical,intent(in) :: debut ! signals first call to physics 35 logical,intent(in) :: lafin ! signals last call to physics 36 real,intent(in) :: pdtphys ! physics time step (s) 37 real,intent(in) :: paprs(klon,klev+1) ! interlayer pressure (Pa) 38 real,intent(in) :: pplay(klon,klev) ! mid-layer pressure (Pa) 39 real,intent(in) :: pphi(klon,klev) ! geopotential at mid-layer 40 real,intent(in) :: pphis(klon) ! surface geopotential 41 real,intent(in) :: presnivs(klev) ! pseudo-pressure (Pa) of mid-layers 42 integer,parameter :: longcles=20 43 real,intent(in) :: clesphy0(longcles) ! Not used 44 real,intent(in) :: u(klon,klev) ! eastward zonal wind (m/s) 45 real,intent(in) :: v(klon,klev) ! northward meridional wind (m/s) 46 real,intent(in) :: t(klon,klev) ! temperature (K) 47 real,intent(in) :: qx(klon,klev,nqtot) ! tracers (.../kg_air) 48 real,intent(in) :: flxmass_w(klon,klev) ! vertical mass flux 49 real,intent(out) :: d_u(klon,klev) ! physics tendency on u (m/s/s) 50 real,intent(out) :: d_v(klon,klev) ! physics tendency on v (m/s/s) 51 real,intent(out) :: d_t(klon,klev) ! physics tendency on t (K/s) 52 real,intent(out) :: d_qx(klon,klev,nqtot) ! physics tendency on tracers 53 real,intent(out) :: d_ps(klon) ! physics tendency on surface pressure 54 real,intent(in) :: dudyn(iim+1,jjmp1,klev) ! Not used 55 !FH! REAL PVteta(klon,nbteta) 56 ! REAL PVteta(klon,1) 57 real,intent(in) :: PVteta(klon,3) ! Not used ; should match definition 58 ! in calfis.F 53 59 54 integer jjmp1 55 parameter (jjmp1=jjm+1-1/jjm) 56 integer iip1 57 parameter (iip1=iim+1) 60 integer,save :: itau=0 ! counter to count number of calls to physics 61 !$OMP THREADPRIVATE(itau) 62 real :: temp_newton(klon,klev) 63 integer :: k 64 logical, save :: first=.true. 65 !$OMP THREADPRIVATE(first) 58 66 59 INTEGER ivap ! indice de traceurs pour vapeur d'eau 60 PARAMETER (ivap=1) 61 INTEGER iliq ! indice de traceurs pour eau liquide 62 PARAMETER (iliq=2) 67 ! For I/Os 68 integer :: itau0 69 real :: zjulian 70 real :: dtime 71 integer :: nhori ! horizontal coordinate ID 72 integer,save :: nid_hist ! output file ID 73 !$OMP THREADPRIVATE(nid_hist) 74 integer :: zvertid ! vertical coordinate ID 75 integer,save :: iwrite_phys ! output every iwrite_phys physics step 76 !$OMP THREADPRIVATE(iwrite_phys) 77 real :: t_ops ! frequency of the IOIPSL operations (eg average over...) 78 real :: t_wrt ! frequency of the IOIPSL outputs 63 79 64 ! 65 ! 66 ! Variables argument: 67 ! 68 INTEGER nlon 69 INTEGER nlev 70 REAL, intent(in):: jD_cur, jH_cur 80 ! initializations 81 if (debut) then ! Things to do only for the first call to physics 82 ! load initial conditions for physics (including the grid) 83 call phys_state_var_init() ! some initializations, required before calling phyetat0 84 call phyetat0("startphy.nc") 71 85 72 REAL pdtphys 73 LOGICAL debut, lafin 74 REAL paprs(klon,klev+1) 75 REAL pplay(klon,klev) 76 REAL pphi(klon,klev) 77 REAL pphis(klon) 78 REAL presnivs(klev) 79 REAL znivsig(klev) 80 real pir 86 ! Initialize outputs: 87 itau0=0 88 iwrite_phys=1 !default: output every physics timestep 89 call getin("iwrite_phys",iwrite_phys) 90 t_ops=pdtphys*iwrite_phys ! frequency of the IOIPSL operation 91 t_wrt=pdtphys*iwrite_phys ! frequency of the outputs in the file 92 ! compute zjulian for annee0=1979 and month=1 dayref=1 and hour=0.0 93 !CALL ymds2ju(annee0, month, dayref, hour, zjulian) 94 call ymds2ju(1979, 1, 1, 0.0, zjulian) 95 dtime=pdtphys 96 call histbeg_phy("histins.nc",itau0,zjulian,dtime,nhori,nid_hist) 97 !$OMP MASTER 98 ! define vertical coordinate 99 call histvert(nid_hist,"presnivs","Vertical levels","Pa",klev, & 100 presnivs,zvertid,'down') 101 ! define variables which will be written in "histins.nc" file 102 call histdef(nid_hist,'temperature','Atmospheric temperature','K', & 103 iim,jj_nb,nhori,klev,1,klev,zvertid,32, & 104 'inst(X)',t_ops,t_wrt) 105 call histdef(nid_hist,'u','Eastward Zonal Wind','m/s', & 106 iim,jj_nb,nhori,klev,1,klev,zvertid,32, & 107 'inst(X)',t_ops,t_wrt) 108 call histdef(nid_hist,'v','Northward Meridional Wind','m/s', & 109 iim,jj_nb,nhori,klev,1,klev,zvertid,32, & 110 'inst(X)',t_ops,t_wrt) 111 call histdef(nid_hist,'ps','Surface Pressure','Pa', & 112 iim,jj_nb,nhori,1,1,1,zvertid,32, & 113 'inst(X)',t_ops,t_wrt) 114 ! end definition sequence 115 call histend(nid_hist) 116 !$OMP END MASTER 117 endif ! of if (debut) 81 118 82 REAL u(klon,klev) 83 REAL v(klon,klev) 84 REAL t(klon,klev),theta(klon,klev) 85 REAL qx(klon,klev,nqtot) 86 REAL flxmass_w(klon,klev) 87 REAL omega(klon,klev) ! vitesse verticale en Pa/s 88 REAL d_u(klon,klev) 89 REAL d_v(klon,klev) 90 REAL d_t(klon,klev) 91 REAL d_qx(klon,klev,nqtot) 92 REAL d_ps(klon) 93 real da(klon,klev),phi(klon,klev,klev),mp(klon,klev) 94 !IM definition dynamique o_trac dans phys_output_open 95 ! type(ctrl_out) :: o_trac(nqtot) 96 !FH! REAL PVteta(klon,nbteta) 97 REAL PVteta(klon,1) 98 REAL dudyn(iim+1,jjmp1,klev) 119 ! increment counter itau 120 itau=itau+1 99 121 100 INTEGER longcles 101 PARAMETER ( longcles = 20 ) 122 ! set all tendencies to zero 123 d_u(1:klon,1:klev)=0. 124 d_v(1:klon,1:klev)=0. 125 d_t(1:klon,1:klev)=0. 126 d_qx(1:klon,1:klev,1:nqtot)=0. 127 d_ps(1:klon)=0. 102 128 103 real temp_newton(klon,klev) 104 integer k 105 logical, save :: first=.true. 106 107 REAL clesphy0( longcles ) 108 109 d_u=0. 110 d_v=0. 111 d_t=0. 112 d_qx=0. 113 d_ps=0. 114 115 d_u(:,1)=-u(:,1)/86400. 116 do k=1,klev 117 temp_newton(:,k)=280.+cos(rlatd(:))*40.-pphi(:,k)/rg*6.e-3 118 d_t(:,k)=(temp_newton(:,k)-t(:,k))/1.e5 119 enddo 129 ! compute tendencies to return to the dynamics: 130 ! "friction" on the first layer 131 d_u(1:klon,1)=-u(1:klon,1)/86400. 132 d_v(1:klon,1)=-v(1:klon,1)/86400. 133 ! newtonian relaxation towards temp_newton() 134 do k=1,klev 135 temp_newton(1:klon,k)=280.+cos(rlatd(1:klon))*40.-pphi(1:klon,k)/rg*6.e-3 136 d_t(1:klon,k)=(temp_newton(1:klon,k)-t(1:klon,k))/1.e5 137 enddo 120 138 121 139 122 print*,'COUCOU PHYDEV' 123 return 124 end 140 !print*,'PHYDEV: itau=',itau 141 142 ! write some outputs: 143 if (modulo(itau,iwrite_phys)==0) then 144 call histwrite_phy(nid_hist,.false.,"temperature",itau,t) 145 call histwrite_phy(nid_hist,.false.,"u",itau,u) 146 call histwrite_phy(nid_hist,.false.,"v",itau,v) 147 call histwrite_phy(nid_hist,.false.,"ps",itau,paprs(:,1)) 148 endif 149 150 ! if lastcall, then it is time to write "restartphy.nc" file 151 if (lafin) then 152 call phyredem("restartphy.nc") 153 endif 154 155 end -
LMDZ5/branches/testing/libf/phylmd/calcul_STDlev.h
r1418 r1707 2 2 c $Header$ 3 3 c 4 c5 4 cIM on initialise les variables 5 c 6 missing_val=nf90_fill_real 7 c 8 cIM freq_moyNMC = frequences auxquelles on moyenne les champs accumules 9 cIM sur les niveaux de pression standard du NMC 10 DO n=1, nout 11 freq_moyNMC(n)=freq_outNMC(n)/freq_calNMC(n) 12 ENDDO 6 13 c 7 14 CALL ini_undefSTD(itap,freq_outNMC) … … 157 164 $ lwup,LWup200) 158 165 c 166 twriteSTD(:,:,1)=tsumSTD(:,:,1) 167 qwriteSTD(:,:,1)=qsumSTD(:,:,1) 168 rhwriteSTD(:,:,1)=rhsumSTD(:,:,1) 169 phiwriteSTD(:,:,1)=phisumSTD(:,:,1) 170 uwriteSTD(:,:,1)=usumSTD(:,:,1) 171 vwriteSTD(:,:,1)=vsumSTD(:,:,1) 172 wwriteSTD(:,:,1)=wsumSTD(:,:,1) 173 174 twriteSTD(:,:,2)=tsumSTD(:,:,2) 175 qwriteSTD(:,:,2)=qsumSTD(:,:,2) 176 rhwriteSTD(:,:,2)=rhsumSTD(:,:,2) 177 phiwriteSTD(:,:,2)=phisumSTD(:,:,2) 178 uwriteSTD(:,:,2)=usumSTD(:,:,2) 179 vwriteSTD(:,:,2)=vsumSTD(:,:,2) 180 wwriteSTD(:,:,2)=wsumSTD(:,:,2) 181 182 twriteSTD(:,:,3)=tlevSTD(:,:) 183 qwriteSTD(:,:,3)=qlevSTD(:,:) 184 rhwriteSTD(:,:,3)=rhlevSTD(:,:) 185 phiwriteSTD(:,:,3)=philevSTD(:,:) 186 uwriteSTD(:,:,3)=ulevSTD(:,:) 187 vwriteSTD(:,:,3)=vlevSTD(:,:) 188 wwriteSTD(:,:,3)=wlevSTD(:,:) 189 190 twriteSTD(:,:,4)=tlevSTD(:,:) 191 qwriteSTD(:,:,4)=qlevSTD(:,:) 192 rhwriteSTD(:,:,4)=rhlevSTD(:,:) 193 phiwriteSTD(:,:,4)=philevSTD(:,:) 194 uwriteSTD(:,:,4)=ulevSTD(:,:) 195 vwriteSTD(:,:,4)=vlevSTD(:,:) 196 wwriteSTD(:,:,4)=wlevSTD(:,:) 197 c 198 cIM initialisation 5eme fichier de sortie 199 twriteSTD(:,:,5)=tlevSTD(:,:) 200 qwriteSTD(:,:,5)=qlevSTD(:,:) 201 rhwriteSTD(:,:,5)=rhlevSTD(:,:) 202 phiwriteSTD(:,:,5)=philevSTD(:,:) 203 uwriteSTD(:,:,5)=ulevSTD(:,:) 204 vwriteSTD(:,:,5)=vlevSTD(:,:) 205 wwriteSTD(:,:,5)=wlevSTD(:,:) 206 c 207 cIM initialisation 6eme fichier de sortie 208 twriteSTD(:,:,6)=tlevSTD(:,:) 209 qwriteSTD(:,:,6)=qlevSTD(:,:) 210 rhwriteSTD(:,:,6)=rhlevSTD(:,:) 211 phiwriteSTD(:,:,6)=philevSTD(:,:) 212 uwriteSTD(:,:,6)=ulevSTD(:,:) 213 vwriteSTD(:,:,6)=vlevSTD(:,:) 214 wwriteSTD(:,:,6)=wlevSTD(:,:) 215 cIM for NMC files 216 DO n=1, nlevSTD3 217 DO k=1, nlevSTD 218 if(rlevSTD3(n).EQ.rlevSTD(k)) THEN 219 twriteSTD3(:,n)=tlevSTD(:,k) 220 qwriteSTD3(:,n)=qlevSTD(:,k) 221 rhwriteSTD3(:,n)=rhlevSTD(:,k) 222 phiwriteSTD3(:,n)=philevSTD(:,k) 223 uwriteSTD3(:,n)=ulevSTD(:,k) 224 vwriteSTD3(:,n)=vlevSTD(:,k) 225 wwriteSTD3(:,n)=wlevSTD(:,k) 226 endif !rlevSTD3(n).EQ.rlevSTD(k) 227 ENDDO 228 ENDDO 229 c 230 DO n=1, nlevSTD8 231 DO k=1, nlevSTD 232 if(rlevSTD8(n).EQ.rlevSTD(k)) THEN 233 tnondefSTD8(:,n)=tnondef(:,k,2) 234 twriteSTD8(:,n)=tsumSTD(:,k,2) 235 qwriteSTD8(:,n)=qsumSTD(:,k,2) 236 rhwriteSTD8(:,n)=rhsumSTD(:,k,2) 237 phiwriteSTD8(:,n)=phisumSTD(:,k,2) 238 uwriteSTD8(:,n)=usumSTD(:,k,2) 239 vwriteSTD8(:,n)=vsumSTD(:,k,2) 240 wwriteSTD8(:,n)=wsumSTD(:,k,2) 241 endif !rlevSTD8(n).EQ.rlevSTD(k) 242 ENDDO 243 ENDDO -
LMDZ5/branches/testing/libf/phylmd/change_srf_frac_mod.F90
r1454 r1707 12 12 13 13 SUBROUTINE change_srf_frac(itime, dtime, jour, & 14 pctsrf, alb1, alb2, tsurf, u 10m, v10m, pbl_tke)14 pctsrf, alb1, alb2, tsurf, ustar, u10m, v10m, pbl_tke) 15 15 ! 16 16 ! This subroutine is called from physiq.F at each timestep. … … 46 46 REAL, DIMENSION(klon,nbsrf), INTENT(INOUT) :: alb2 ! albedo second interval in SW spektrum 47 47 REAL, DIMENSION(klon,nbsrf), INTENT(INOUT) :: tsurf 48 REAL, DIMENSION(klon,nbsrf), INTENT(INOUT) :: ustar 48 49 REAL, DIMENSION(klon,nbsrf), INTENT(INOUT) :: u10m 49 50 REAL, DIMENSION(klon,nbsrf), INTENT(INOUT) :: v10m … … 150 151 ! 151 152 !**************************************************************************************** 152 CALL pbl_surface_newfrac(itime, pctsrf, pctsrf_old, tsurf, alb1, alb2, u 10m, v10m, pbl_tke)153 CALL pbl_surface_newfrac(itime, pctsrf, pctsrf_old, tsurf, alb1, alb2, ustar, u10m, v10m, pbl_tke) 153 154 154 155 ELSE -
LMDZ5/branches/testing/libf/phylmd/iniphysiq.F
r1403 r1707 8 8 $ pdayref,ptimestep, 9 9 $ plat,plon,parea,pcu,pcv, 10 $ prad,pg,pr,pcpp) 11 USE dimphy 12 USE mod_grid_phy_lmdz 13 USE mod_phys_lmdz_para 14 USE comgeomphy 10 $ prad,pg,pr,pcpp,iflag_phys) 11 USE dimphy, only : klev 12 USE mod_grid_phy_lmdz, only : klon_glo 13 USE mod_phys_lmdz_para, only : klon_omp,klon_omp_begin, 14 & klon_omp_end,klon_mpi_begin 15 USE comgeomphy, only : airephy,cuphy,cvphy,rlond,rlatd 15 16 16 17 IMPLICIT NONE … … 18 19 c======================================================================= 19 20 c 20 c subject:21 c --------21 c Initialisation of the physical constants and some positional and 22 c geometrical arrays for the physics 22 23 c 23 c Initialisation for the physical parametrisations of the LMD24 c martian atmospheric general circulation modele.25 c26 c author: Frederic Hourdin 15 / 10 /9327 c -------28 c29 c arguments:30 c ----------31 c32 c input:33 c ------34 24 c 35 25 c ngrid Size of the horizontal grid. … … 37 27 c nlayer Number of vertical layers. 38 28 c pdayref Day of reference for the simulation 39 c firstcall True at the first call40 c lastcall True at the last call41 c pday Number of days counted from the North. Spring42 c equinoxe.43 29 c 44 30 c======================================================================= 45 c46 c-----------------------------------------------------------------------47 c declarations:48 c -------------49 31 50 32 cym#include "dimensions.h" … … 52 34 cym#include "comgeomphy.h" 53 35 #include "YOMCST.h" 54 REAL prad,pg,pr,pcpp,punjours 55 56 INTEGER ngrid,nlayer 57 REAL plat(ngrid),plon(ngrid),parea(klon_glo) 58 REAL pcu(klon_glo),pcv(klon_glo) 59 INTEGER pdayref 60 INTEGER :: ibegin,iend,offset 61 62 REAL ptimestep 36 #include "iniprint.h" 37 38 REAL,INTENT(IN) :: prad ! radius of the planet (m) 39 REAL,INTENT(IN) :: pg ! gravitational acceleration (m/s2) 40 REAL,INTENT(IN) :: pr ! ! reduced gas constant R/mu 41 REAL,INTENT(IN) :: pcpp ! specific heat Cp 42 REAL,INTENT(IN) :: punjours ! length (in s) of a standard day 43 INTEGER,INTENT(IN) :: ngrid ! number of horizontal grid points in the physics 44 INTEGER,INTENT(IN) :: nlayer ! number of atmospheric layers 45 REAL,INTENT(IN) :: plat(ngrid) ! latitudes of the physics grid 46 REAL,INTENT(IN) :: plon(ngrid) ! longitudes of the physics grid 47 REAL,INTENT(IN) :: parea(klon_glo) ! area (m2) 48 REAL,INTENT(IN) :: pcu(klon_glo) ! cu coeff. (u_covariant = cu * u) 49 REAL,INTENT(IN) :: pcv(klon_glo) ! cv coeff. (v_covariant = cv * v) 50 INTEGER,INTENT(IN) :: pdayref ! reference day of for the simulation 51 REAL,INTENT(IN) :: ptimestep !physics time step (s) 52 INTEGER,INTENT(IN) :: iflag_phys ! type of physics to be called 53 54 INTEGER :: ibegin,iend,offset 63 55 CHARACTER (LEN=20) :: modname='iniphysiq' 64 56 CHARACTER (LEN=80) :: abort_message 65 57 66 58 IF (nlayer.NE.klev) THEN 67 PRINT*,'STOP in inifis'68 PRINT*,'Probleme dedimensions :'69 PRINT*,'nlayer = ',nlayer70 PRINT*,'klev = ',klev59 write(lunout,*) 'STOP in ',trim(modname) 60 write(lunout,*) 'Problem with dimensions :' 61 write(lunout,*) 'nlayer = ',nlayer 62 write(lunout,*) 'klev = ',klev 71 63 abort_message = '' 72 64 CALL abort_gcm (modname,abort_message,1) … … 74 66 75 67 IF (ngrid.NE.klon_glo) THEN 76 PRINT*,'STOP in inifis'77 PRINT*,'Probleme dedimensions :'78 PRINT*,'ngrid = ',ngrid79 PRINT*,'klon = ',klon_glo68 write(lunout,*) 'STOP in ',trim(modname) 69 write(lunout,*) 'Problem with dimensions :' 70 write(lunout,*) 'ngrid = ',ngrid 71 write(lunout,*) 'klon = ',klon_glo 80 72 abort_message = '' 81 73 CALL abort_gcm (modname,abort_message,1) 82 74 ENDIF 83 c$OMP PARALLEL PRIVATE(ibegin,iend) 84 c$OMP+ SHARED(parea,pcu,pcv,plon,plat) 75 76 !$OMP PARALLEL PRIVATE(ibegin,iend) 77 !$OMP+ SHARED(parea,pcu,pcv,plon,plat) 85 78 86 79 offset=klon_mpi_begin-1 … … 92 85 rlatd(1:klon_omp)=plat(offset+klon_omp_begin:offset+klon_omp_end) 93 86 87 ! suphel => initialize some physical constants (orbital parameters, 88 ! geoid, gravity, thermodynamical constants, etc.) in the 89 ! physics 94 90 call suphel 91 92 !$OMP END PARALLEL 95 93 96 c$OMP END PARALLEL 94 ! check that physical constants set in 'suphel' are coherent 95 ! with values set in the dynamics: 96 if (RDAY.ne.punjours) then 97 write(lunout,*) "iniphysiq: length of day discrepancy!!!" 98 write(lunout,*) " in the dynamics punjours=",punjours 99 write(lunout,*) " but in the physics RDAY=",RDAY 100 if (abs(RDAY-punjours).gt.0.01) then 101 ! stop here if the relative difference is more than 1% 102 abort_message = 'length of day discrepancy' 103 CALL abort_gcm (modname,abort_message,1) 104 endif 105 endif 106 if (RG.ne.pg) then 107 write(lunout,*) "iniphysiq: gravity discrepancy !!!" 108 write(lunout,*) " in the dynamics pg=",pg 109 write(lunout,*) " but in the physics RG=",RG 110 if (abs(RG-pg).gt.0.01) then 111 ! stop here if the relative difference is more than 1% 112 abort_message = 'gravity discrepancy' 113 CALL abort_gcm (modname,abort_message,1) 114 endif 115 endif 116 if (RA.ne.prad) then 117 write(lunout,*) "iniphysiq: planet radius discrepancy !!!" 118 write(lunout,*) " in the dynamics prad=",prad 119 write(lunout,*) " but in the physics RA=",RA 120 if (abs(RA-prad).gt.0.01) then 121 ! stop here if the relative difference is more than 1% 122 abort_message = 'planet radius discrepancy' 123 CALL abort_gcm (modname,abort_message,1) 124 endif 125 endif 126 if (RD.ne.pr) then 127 write(lunout,*)"iniphysiq: reduced gas constant discrepancy !!!" 128 write(lunout,*)" in the dynamics pr=",pr 129 write(lunout,*)" but in the physics RD=",RD 130 if (abs(RD-pr).gt.0.01) then 131 ! stop here if the relative difference is more than 1% 132 abort_message = 'reduced gas constant discrepancy' 133 CALL abort_gcm (modname,abort_message,1) 134 endif 135 endif 136 if (RCPD.ne.pcpp) then 137 write(lunout,*)"iniphysiq: specific heat discrepancy !!!" 138 write(lunout,*)" in the dynamics pcpp=",pcpp 139 write(lunout,*)" but in the physics RCPD=",RCPD 140 if (abs(RCPD-pcpp).gt.0.01) then 141 ! stop here if the relative difference is more than 1% 142 abort_message = 'specific heat discrepancy' 143 CALL abort_gcm (modname,abort_message,1) 144 endif 145 endif 97 146 98 print*,'ATTENTION !!! TRAVAILLER SUR INIPHYSIQ' 99 print*,'CONTROLE DES LATITUDES, LONGITUDES, PARAMETRES ...' 147 ! Additional initializations for aquaplanets 148 !$OMP PARALLEL 149 if (iflag_phys>=100) then 150 call iniaqua(klon_omp,rlatd,rlond,iflag_phys) 151 endif 152 !$OMP END PARALLEL 100 153 101 RETURN102 9999 CONTINUE103 abort_message ='Cette version demande les fichier rnatur.dat104 & et surf.def'105 CALL abort_gcm (modname,abort_message,1)154 ! RETURN 155 !9999 CONTINUE 156 ! abort_message ='Cette version demande les fichier rnatur.dat 157 ! & et surf.def' 158 ! CALL abort_gcm (modname,abort_message,1) 106 159 107 160 END -
LMDZ5/branches/testing/libf/phylmd/iophy.F90
r1539 r1707 51 51 52 52 !$OMP MASTER 53 ALLOCATE(io_lat(jjm+1-1/ iim))53 ALLOCATE(io_lat(jjm+1-1/(iim*jjm))) 54 54 io_lat(1)=rlat_glo(1) 55 io_lat(jjm+1-1/ iim)=rlat_glo(klon_glo)56 IF ( iim> 1) then55 io_lat(jjm+1-1/(iim*jjm))=rlat_glo(klon_glo) 56 IF ((iim*jjm) > 1) then 57 57 DO i=2,jjm 58 58 io_lat(i)=rlat_glo(2+(i-2)*iim) … … 61 61 62 62 ALLOCATE(io_lon(iim)) 63 io_lon(:)=rlon_glo(2-1/ iim:iim+1-1/iim)63 io_lon(:)=rlon_glo(2-1/(iim*jjm):iim+1-1/(iim*jjm)) 64 64 65 65 ddid=(/ 1,2 /) 66 dsg=(/ iim, jjm+1-1/ iim/)66 dsg=(/ iim, jjm+1-1/(iim*jjm) /) 67 67 dsl=(/ iim, jj_nb /) 68 68 dpf=(/ 1,jj_begin /) … … 89 89 include 'dimensions.h' 90 90 real,dimension(iim),intent(in) :: lon 91 real,dimension(jjm+1-1/ iim),intent(in) :: lat91 real,dimension(jjm+1-1/(iim*jjm)),intent(in) :: lat 92 92 93 93 INTEGER,DIMENSION(2) :: ddid … … 100 100 101 101 !$OMP MASTER 102 allocate(io_lat(jjm+1-1/ iim))102 allocate(io_lat(jjm+1-1/(iim*jjm))) 103 103 io_lat(:)=lat(:) 104 104 allocate(io_lon(iim)) … … 106 106 107 107 ddid=(/ 1,2 /) 108 dsg=(/ iim, jjm+1-1/ iim/)108 dsg=(/ iim, jjm+1-1/(iim*jjm) /) 109 109 dsl=(/ iim, jj_nb /) 110 110 dpf=(/ 1,jj_begin /) … … 234 234 235 235 CALL gr_fi_ecrit(1,klon,iim,jjmp1,rlon_glo,zx_lon) 236 if ( iim.gt.1) then236 if ((iim*jjm).gt.1) then 237 237 DO i = 1, iim 238 238 zx_lon(i,1) = rlon_glo(i+1) -
LMDZ5/branches/testing/libf/phylmd/mod_grid_phy_lmdz.F90
r1001 r1707 1 1 ! 2 !$ Header$2 !$Id $ 3 3 ! 4 4 MODULE mod_grid_phy_lmdz 5 6 PUBLIC 7 PRIVATE :: grid1dTo2d_glo_igen, grid1dTo2d_glo_rgen, grid1dTo2d_glo_lgen, & 8 grid2dTo1d_glo_igen, grid2dTo1d_glo_rgen, grid2dTo1d_glo_lgen 9 5 10 INTEGER,SAVE :: nbp_lon ! == iim 6 11 INTEGER,SAVE :: nbp_lat ! == jjmp1 … … 271 276 END SUBROUTINE grid2dTo1d_glo_l3 272 277 273 END MODULE mod_grid_phy_lmdz 274 275 278 !---------------------------------------------------------------- 279 ! Generic (private) fonctions 280 !---------------------------------------------------------------- 276 281 277 282 SUBROUTINE grid1dTo2d_glo_igen(VarIn,VarOut,dimsize) 278 USE mod_grid_phy_lmdz 283 279 284 IMPLICIT NONE 280 285 … … 311 316 312 317 SUBROUTINE grid1dTo2d_glo_rgen(VarIn,VarOut,dimsize) 313 USE mod_grid_phy_lmdz 318 314 319 IMPLICIT NONE 315 320 … … 345 350 346 351 SUBROUTINE grid1dTo2d_glo_lgen(VarIn,VarOut,dimsize) 347 USE mod_grid_phy_lmdz 352 348 353 IMPLICIT NONE 349 354 … … 379 384 380 385 SUBROUTINE grid2dTo1d_glo_igen(VarIn,VarOut,dimsize) 381 USE mod_grid_phy_lmdz 386 382 387 IMPLICIT NONE 383 388 … … 402 407 403 408 SUBROUTINE grid2dTo1d_glo_rgen(VarIn,VarOut,dimsize) 404 USE mod_grid_phy_lmdz 409 405 410 IMPLICIT NONE 406 411 … … 425 430 426 431 SUBROUTINE grid2dTo1d_glo_lgen(VarIn,VarOut,dimsize) 427 USE mod_grid_phy_lmdz 432 428 433 IMPLICIT NONE 429 434 … … 446 451 447 452 END SUBROUTINE grid2dTo1d_glo_lgen 453 454 END MODULE mod_grid_phy_lmdz -
LMDZ5/branches/testing/libf/phylmd/pbl_surface_mod.F90
r1664 r1707 172 172 t, q, u, v, & 173 173 pplay, paprs, pctsrf, & 174 ts, alb1, alb2, u10m,v10m, &174 ts, alb1, alb2,ustar, u10m, v10m, & 175 175 lwdown_m, cdragh, cdragm, zu1, zv1, & 176 176 alb1_m, alb2_m, zxsens, zxevap, & … … 181 181 s_capCL, s_oliqCL, s_cteiCL, s_pblT, & 182 182 s_therm, s_trmb1, s_trmb2, s_trmb3, & 183 zxrugs, zu10m,zv10m, fder_print, &183 zxrugs,zustar,zu10m, zv10m, fder_print, & 184 184 zxqsurf, rh2m, zxfluxu, zxfluxv, & 185 185 rugos_d, agesno_d, sollw, solsw, & … … 288 288 REAL, DIMENSION(klon, nbsrf), INTENT(INOUT) :: alb1 ! albedo in visible SW interval 289 289 REAL, DIMENSION(klon, nbsrf), INTENT(INOUT) :: alb2 ! albedo in near infra-red SW interval 290 REAL, DIMENSION(klon, nbsrf), INTENT(INOUT) :: ustar ! u* (m/s) 290 291 REAL, DIMENSION(klon, nbsrf), INTENT(INOUT) :: u10m ! u speed at 10m 291 292 REAL, DIMENSION(klon, nbsrf), INTENT(INOUT) :: v10m ! v speed at 10m … … 330 331 REAL, DIMENSION(klon), INTENT(OUT) :: s_trmb3 ! point Omega, mean for each grid point 331 332 REAL, DIMENSION(klon), INTENT(OUT) :: zxrugs ! rugosity at surface (m), mean for each grid point 333 REAL, DIMENSION(klon), INTENT(OUT) :: zustar ! u* 332 334 REAL, DIMENSION(klon), INTENT(OUT) :: zu10m ! u speed at 10m, mean for each grid point 333 335 REAL, DIMENSION(klon), INTENT(OUT) :: zv10m ! v speed at 10m, mean for each grid point … … 1019 1021 t2m(:,nsrf) = 0. 1020 1022 q2m(:,nsrf) = 0. 1023 ustar(:,nsrf) = 0. 1021 1024 u10m(:,nsrf) = 0. 1022 1025 v10m(:,nsrf) = 0. 1023 1024 1026 pblh(:,nsrf) = 0. ! Hauteur de couche limite 1025 1027 plcl(:,nsrf) = 0. ! Niveau de condensation de la CLA … … 1069 1071 1070 1072 ! u10m, v10m : composantes du vent a 10m sans spirale de Ekman 1073 ustar(i,nsrf)=yustar(j) 1071 1074 u10m(i,nsrf)=(yu10m(j) * uzon(j))/SQRT(uzon(j)**2+vmer(j)**2) 1072 1075 v10m(i,nsrf)=(yu10m(j) * vmer(j))/SQRT(uzon(j)**2+vmer(j)**2) 1076 1073 1077 END DO 1074 1078 … … 1150 1154 zxtsol(:) = 0.0 ; zxfluxlat(:) = 0.0 1151 1155 zt2m(:) = 0.0 ; zq2m(:) = 0.0 1152 zu 10m(:) = 0.0 ; zv10m(:) = 0.01156 zustar(:)=0.0 ; zu10m(:) = 0.0 ; zv10m(:) = 0.0 1153 1157 s_pblh(:) = 0.0 ; s_plcl(:) = 0.0 1154 1158 s_capCL(:) = 0.0 ; s_oliqCL(:) = 0.0 … … 1172 1176 zt2m(i) = zt2m(i) + t2m(i,nsrf) * pctsrf(i,nsrf) 1173 1177 zq2m(i) = zq2m(i) + q2m(i,nsrf) * pctsrf(i,nsrf) 1178 zustar(i) = zustar(i) + ustar(i,nsrf) * pctsrf(i,nsrf) 1174 1179 zu10m(i) = zu10m(i) + u10m(i,nsrf) * pctsrf(i,nsrf) 1175 1180 zv10m(i) = zv10m(i) + v10m(i,nsrf) * pctsrf(i,nsrf) … … 1305 1310 !**************************************************************************************** 1306 1311 ! 1307 SUBROUTINE pbl_surface_newfrac(itime, pctsrf_new, pctsrf_old, tsurf, alb1, alb2, u 10m, v10m, tke)1312 SUBROUTINE pbl_surface_newfrac(itime, pctsrf_new, pctsrf_old, tsurf, alb1, alb2, ustar, u10m, v10m, tke) 1308 1313 1309 1314 ! Give default values where new fraction has appread … … 1323 1328 REAL, DIMENSION(klon,nbsrf), INTENT(INOUT) :: tsurf 1324 1329 REAL, DIMENSION(klon,nbsrf), INTENT(INOUT) :: alb1, alb2 1325 REAL, DIMENSION(klon,nbsrf), INTENT(INOUT) :: u 10m, v10m1330 REAL, DIMENSION(klon,nbsrf), INTENT(INOUT) :: ustar,u10m, v10m 1326 1331 REAL, DIMENSION(klon,klev+1,nbsrf), INTENT(INOUT) :: tke 1327 1332 … … 1369 1374 alb1(i,nsrf) = alb1(i,nsrf_comp1) 1370 1375 alb2(i,nsrf) = alb2(i,nsrf_comp1) 1376 ustar(i,nsrf) = ustar(i,nsrf_comp1) 1371 1377 u10m(i,nsrf) = u10m(i,nsrf_comp1) 1372 1378 v10m(i,nsrf) = v10m(i,nsrf_comp1) … … 1383 1389 alb1(i,nsrf) = alb1(i,nsrf_comp2) *pctsrf_old(i,nsrf_comp2) + alb1(i,nsrf_comp3) *pctsrf_old(i,nsrf_comp3) 1384 1390 alb2(i,nsrf) = alb2(i,nsrf_comp2) *pctsrf_old(i,nsrf_comp2) + alb2(i,nsrf_comp3) *pctsrf_old(i,nsrf_comp3) 1391 ustar(i,nsrf) = ustar(i,nsrf_comp2) *pctsrf_old(i,nsrf_comp2) + ustar(i,nsrf_comp3) *pctsrf_old(i,nsrf_comp3) 1385 1392 u10m(i,nsrf) = u10m(i,nsrf_comp2) *pctsrf_old(i,nsrf_comp2) + u10m(i,nsrf_comp3) *pctsrf_old(i,nsrf_comp3) 1386 1393 v10m(i,nsrf) = v10m(i,nsrf_comp2) *pctsrf_old(i,nsrf_comp2) + v10m(i,nsrf_comp3) *pctsrf_old(i,nsrf_comp3) -
LMDZ5/branches/testing/libf/phylmd/phyaqua.F
r1530 r1707 16 16 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 17 17 18 use comgeomphy 19 use dimphy 18 use comgeomphy, only : rlatd,rlond 19 use dimphy, only : klon 20 20 use surface_data, only : type_ocean,ok_veget 21 21 use pbl_surface_mod, only : pbl_surface_init 22 22 USE fonte_neige_mod, only : fonte_neige_init 23 23 use phys_state_var_mod 24 use control_mod 25 24 use control_mod, only : dayref,nday,iphysiq 26 25 27 26 USE IOIPSL … … 35 34 #include "dimsoil.h" 36 35 #include "indicesol.h" 37 38 integer nlon,iflag_phys 36 #include "temps.h" 37 38 integer,intent(in) :: nlon,iflag_phys 39 39 cIM ajout latfi, lonfi 40 REAL, DIMENSION (nlon) :: lonfi, latfi 40 real,intent(in) :: lonfi(nlon),latfi(nlon) 41 41 42 INTEGER type_profil,type_aqua 42 43 … … 71 72 ! integer demih_pas 72 73 73 integer day_ini74 75 74 CHARACTER*80 ans,file_forctl, file_fordat, file_start 76 75 character*100 file,var … … 88 87 REAL phy_flic(nlon,360) 89 88 90 integer, save:: read_climoz ! read ozone climatology89 integer, save:: read_climoz=0 ! read ozone climatology 91 90 92 91 … … 131 130 type_aqua=iflag_phys/100 132 131 type_profil=iflag_phys-type_aqua*100 133 print*,'type_aqua, type_profil',type_aqua, type_profil 134 135 if (klon.ne.nlon) stop'probleme de dimensions dans iniaqua' 132 print*,'iniaqua:type_aqua, type_profil',type_aqua, type_profil 133 134 if (klon.ne.nlon) then 135 write(*,*)"iniaqua: klon=",klon," nlon=",nlon 136 stop'probleme de dimensions dans iniaqua' 137 endif 136 138 call phys_state_var_init(read_climoz) 137 139 … … 154 156 155 157 day_ini=dayref 158 day_end=day_ini+nday 156 159 airefi=1. 157 160 zcufi=1. … … 171 174 radsol=0. 172 175 qsol_f=10. 173 CALL getin('albedo',albedo) 176 ! CALL getin('albedo',albedo) ! albedo is set below, depending on type_aqua 174 177 alb_ocean=.true. 175 178 CALL getin('alb_ocean',alb_ocean) … … 180 183 qsol(:) = qsol_f 181 184 rugsrel = 0.0 ! (rugsrel = rugoro) 185 rugoro = 0.0 186 u_ancien = 0.0 187 v_ancien = 0.0 182 188 agesno = 50.0 183 189 ! Relief plat … … 308 314 . evap, frugs, agesno, tsoil) 309 315 310 print*,' avant phyredem dans iniaqua'316 print*,'iniaqua: before phyredem' 311 317 312 318 falb1=albedo … … 329 335 CALL phyredem ("startphy.nc") 330 336 331 print*,' apresphyredem'337 print*,'iniaqua: after phyredem' 332 338 call phys_state_var_end 333 339 … … 450 456 RETURN 451 457 END 458 459 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 460 452 461 subroutine writelim 453 462 s (klon,phy_nat,phy_alb,phy_sst,phy_bil,phy_rug,phy_ice, 454 463 s phy_fter,phy_foce,phy_flic,phy_fsic) 455 464 c 465 use mod_phys_lmdz_para, only: is_mpi_root,is_omp_root 466 use mod_grid_phy_lmdz, only : klon_glo 467 use mod_phys_lmdz_transfert_para, only : gather 456 468 !#include "dimensions.h" 457 469 !#include "dimphy.h" 458 470 #include "netcdf.inc" 459 471 460 integer klon 461 REAL phy_nat(klon,360) 462 REAL phy_alb(klon,360) 463 REAL phy_sst(klon,360) 464 REAL phy_bil(klon,360) 465 REAL phy_rug(klon,360) 466 REAL phy_ice(klon,360) 467 REAL phy_fter(klon,360) 468 REAL phy_foce(klon,360) 469 REAL phy_flic(klon,360) 470 REAL phy_fsic(klon,360) 471 472 integer,intent(in) :: klon 473 real,intent(in) :: phy_nat(klon,360) 474 real,intent(in) :: phy_alb(klon,360) 475 real,intent(in) :: phy_sst(klon,360) 476 real,intent(in) :: phy_bil(klon,360) 477 real,intent(in) :: phy_rug(klon,360) 478 real,intent(in) :: phy_ice(klon,360) 479 real,intent(in) :: phy_fter(klon,360) 480 real,intent(in) :: phy_foce(klon,360) 481 real,intent(in) :: phy_flic(klon,360) 482 real,intent(in) :: phy_fsic(klon,360) 483 484 real :: phy_glo(klon_glo,360) ! temporary variable, to store phy_***(:) 485 ! on the whole physics grid 472 486 INTEGER ierr 473 487 INTEGER dimfirst(3) … … 480 494 INTEGER id_FTER,id_FOCE,id_FSIC,id_FLIC 481 495 482 PRINT*, 'Ecriture du fichier limit' 483 c 484 ierr = NF_CREATE ("limit.nc", NF_CLOBBER, nid) 485 c 486 ierr = NF_PUT_ATT_TEXT (nid, NF_GLOBAL, "title", 30, 496 if (is_mpi_root.and.is_omp_root) then 497 498 PRINT*, 'writelim: Ecriture du fichier limit' 499 c 500 ierr = NF_CREATE ("limit.nc", NF_CLOBBER, nid) 501 c 502 ierr = NF_PUT_ATT_TEXT (nid, NF_GLOBAL, "title", 30, 487 503 . "Fichier conditions aux limites") 488 ierr = NF_DEF_DIM (nid, "points_physiques", klon, ndim) 489 ierr = NF_DEF_DIM (nid, "time", NF_UNLIMITED, ntim) 490 c 491 dims(1) = ndim 492 dims(2) = ntim 504 !! ierr = NF_DEF_DIM (nid, "points_physiques", klon, ndim) 505 ierr = NF_DEF_DIM (nid, "points_physiques", klon_glo, ndim) 506 ierr = NF_DEF_DIM (nid, "time", NF_UNLIMITED, ntim) 507 c 508 dims(1) = ndim 509 dims(2) = ntim 493 510 c 494 511 ccc ierr = NF_DEF_VAR (nid, "TEMPS", NF_DOUBLE, 1,ntim, id_tim) 495 ierr = NF_DEF_VAR (nid, "TEMPS", NF_FLOAT, 1,ntim, id_tim)496 ierr = NF_PUT_ATT_TEXT (nid, id_tim, "title", 17,512 ierr = NF_DEF_VAR (nid, "TEMPS", NF_FLOAT, 1,ntim, id_tim) 513 ierr = NF_PUT_ATT_TEXT (nid, id_tim, "title", 17, 497 514 . "Jour dans l annee") 498 515 ccc ierr = NF_DEF_VAR (nid, "NAT", NF_DOUBLE, 2,dims, id_NAT) 499 ierr = NF_DEF_VAR (nid, "NAT", NF_FLOAT, 2,dims, id_NAT)500 ierr = NF_PUT_ATT_TEXT (nid, id_NAT, "title", 23,516 ierr = NF_DEF_VAR (nid, "NAT", NF_FLOAT, 2,dims, id_NAT) 517 ierr = NF_PUT_ATT_TEXT (nid, id_NAT, "title", 23, 501 518 . "Nature du sol (0,1,2,3)") 502 519 ccc ierr = NF_DEF_VAR (nid, "SST", NF_DOUBLE, 2,dims, id_SST) 503 ierr = NF_DEF_VAR (nid, "SST", NF_FLOAT, 2,dims, id_SST)504 ierr = NF_PUT_ATT_TEXT (nid, id_SST, "title", 35,520 ierr = NF_DEF_VAR (nid, "SST", NF_FLOAT, 2,dims, id_SST) 521 ierr = NF_PUT_ATT_TEXT (nid, id_SST, "title", 35, 505 522 . "Temperature superficielle de la mer") 506 523 ccc ierr = NF_DEF_VAR (nid, "BILS", NF_DOUBLE, 2,dims, id_BILS) 507 ierr = NF_DEF_VAR (nid, "BILS", NF_FLOAT, 2,dims, id_BILS)508 ierr = NF_PUT_ATT_TEXT (nid, id_BILS, "title", 32,524 ierr = NF_DEF_VAR (nid, "BILS", NF_FLOAT, 2,dims, id_BILS) 525 ierr = NF_PUT_ATT_TEXT (nid, id_BILS, "title", 32, 509 526 . "Reference flux de chaleur au sol") 510 527 ccc ierr = NF_DEF_VAR (nid, "ALB", NF_DOUBLE, 2,dims, id_ALB) 511 ierr = NF_DEF_VAR (nid, "ALB", NF_FLOAT, 2,dims, id_ALB)512 ierr = NF_PUT_ATT_TEXT (nid, id_ALB, "title", 19,528 ierr = NF_DEF_VAR (nid, "ALB", NF_FLOAT, 2,dims, id_ALB) 529 ierr = NF_PUT_ATT_TEXT (nid, id_ALB, "title", 19, 513 530 . "Albedo a la surface") 514 531 ccc ierr = NF_DEF_VAR (nid, "RUG", NF_DOUBLE, 2,dims, id_RUG) 515 ierr = NF_DEF_VAR (nid, "RUG", NF_FLOAT, 2,dims, id_RUG)516 ierr = NF_PUT_ATT_TEXT (nid, id_RUG, "title", 8,532 ierr = NF_DEF_VAR (nid, "RUG", NF_FLOAT, 2,dims, id_RUG) 533 ierr = NF_PUT_ATT_TEXT (nid, id_RUG, "title", 8, 517 534 . "Rugosite") 518 535 519 ierr = NF_DEF_VAR (nid, "FTER", NF_FLOAT, 2,dims, id_FTER) 520 ierr = NF_PUT_ATT_TEXT (nid, id_FTER, "title", 8,"Frac. Terre") 521 ierr = NF_DEF_VAR (nid, "FOCE", NF_FLOAT, 2,dims, id_FOCE) 522 ierr = NF_PUT_ATT_TEXT (nid, id_FOCE, "title", 8,"Frac. Terre") 523 ierr = NF_DEF_VAR (nid, "FSIC", NF_FLOAT, 2,dims, id_FSIC) 524 ierr = NF_PUT_ATT_TEXT (nid, id_FSIC, "title", 8,"Frac. Terre") 525 ierr = NF_DEF_VAR (nid, "FLIC", NF_FLOAT, 2,dims, id_FLIC) 526 ierr = NF_PUT_ATT_TEXT (nid, id_FLIC, "title", 8,"Frac. Terre") 527 c 528 ierr = NF_ENDDEF(nid) 529 c 530 DO k = 1, 360 531 c 532 debut(1) = 1 533 debut(2) = k 534 epais(1) = klon 535 epais(2) = 1 536 c 537 print*,'Instant ',k 538 #ifdef NC_DOUBLE 539 print*,'NC DOUBLE' 540 ierr = NF_PUT_VAR1_DOUBLE (nid,id_tim,k,DBLE(k)) 541 ierr = NF_PUT_VARA_DOUBLE (nid,id_NAT,debut,epais,phy_nat(1,k)) 542 ierr = NF_PUT_VARA_DOUBLE (nid,id_SST,debut,epais,phy_sst(1,k)) 543 ierr = NF_PUT_VARA_DOUBLE (nid,id_BILS,debut,epais,phy_bil(1,k)) 544 ierr = NF_PUT_VARA_DOUBLE (nid,id_ALB,debut,epais,phy_alb(1,k)) 545 ierr = NF_PUT_VARA_DOUBLE (nid,id_RUG,debut,epais,phy_rug(1,k)) 546 ierr = NF_PUT_VARA_DOUBLE (nid,id_FTER,debut,epais,phy_fter(1,k)) 547 ierr = NF_PUT_VARA_DOUBLE (nid,id_FOCE,debut,epais,phy_foce(1,k)) 548 ierr = NF_PUT_VARA_DOUBLE (nid,id_FSIC,debut,epais,phy_fsic(1,k)) 549 ierr = NF_PUT_VARA_DOUBLE (nid,id_FLIC,debut,epais,phy_flic(1,k)) 550 #else 551 print*,'NC PAS DOUBLE' 552 ierr = NF_PUT_VAR1_REAL (nid,id_tim,k,FLOAT(k)) 553 ierr = NF_PUT_VARA_REAL (nid,id_NAT,debut,epais,phy_nat(1,k)) 554 ierr = NF_PUT_VARA_REAL (nid,id_SST,debut,epais,phy_sst(1,k)) 555 ierr = NF_PUT_VARA_REAL (nid,id_BILS,debut,epais,phy_bil(1,k)) 556 ierr = NF_PUT_VARA_REAL (nid,id_ALB,debut,epais,phy_alb(1,k)) 557 ierr = NF_PUT_VARA_REAL (nid,id_RUG,debut,epais,phy_rug(1,k)) 558 ierr = NF_PUT_VARA_REAL (nid,id_FTER,debut,epais,phy_fter(1,k)) 559 ierr = NF_PUT_VARA_REAL (nid,id_FOCE,debut,epais,phy_foce(1,k)) 560 ierr = NF_PUT_VARA_REAL (nid,id_FSIC,debut,epais,phy_fsic(1,k)) 561 ierr = NF_PUT_VARA_REAL (nid,id_FLIC,debut,epais,phy_flic(1,k)) 562 563 #endif 564 c 565 ENDDO 566 c 567 ierr = NF_CLOSE(nid) 568 c 569 return 536 ierr = NF_DEF_VAR (nid, "FTER", NF_FLOAT, 2,dims, id_FTER) 537 ierr = NF_PUT_ATT_TEXT (nid, id_FTER, "title", 8,"Frac. Terre") 538 ierr = NF_DEF_VAR (nid, "FOCE", NF_FLOAT, 2,dims, id_FOCE) 539 ierr = NF_PUT_ATT_TEXT (nid, id_FOCE, "title", 8,"Frac. Terre") 540 ierr = NF_DEF_VAR (nid, "FSIC", NF_FLOAT, 2,dims, id_FSIC) 541 ierr = NF_PUT_ATT_TEXT (nid, id_FSIC, "title", 8,"Frac. Terre") 542 ierr = NF_DEF_VAR (nid, "FLIC", NF_FLOAT, 2,dims, id_FLIC) 543 ierr = NF_PUT_ATT_TEXT (nid, id_FLIC, "title", 8,"Frac. Terre") 544 c 545 ierr = NF_ENDDEF(nid) 546 c 547 548 ! write the 'times' 549 do k=1,360 550 #ifdef NC_DOUBLE 551 ierr = NF_PUT_VAR1_DOUBLE (nid,id_tim,k,DBLE(k)) 552 #else 553 ierr = NF_PUT_VAR1_REAL (nid,id_tim,k,FLOAT(k)) 554 #endif 555 enddo 556 557 endif ! of if (is_mpi_root.and.is_omp_root) 558 559 ! write the fields, after having collected them on master 560 561 call gather(phy_nat,phy_glo) 562 if (is_mpi_root.and.is_omp_root) then 563 #ifdef NC_DOUBLE 564 ierr=NF_PUT_VAR_DOUBLE(nid,id_NAT,phy_glo) 565 #else 566 ierr=NF_PUT_VAR_REAL(nid,id_NAT,phy_glo) 567 #endif 568 if(ierr.ne.NF_NOERR) then 569 write(*,*) "writelim error with phy_nat" 570 write(*,*) NF_STRERROR(ierr) 571 endif 572 endif 573 574 call gather(phy_sst,phy_glo) 575 if (is_mpi_root.and.is_omp_root) then 576 #ifdef NC_DOUBLE 577 ierr=NF_PUT_VAR_DOUBLE(nid,id_SST,phy_glo) 578 #else 579 ierr=NF_PUT_VAR_REAL(nid,id_SST,phy_glo) 580 #endif 581 if(ierr.ne.NF_NOERR) then 582 write(*,*) "writelim error with phy_sst" 583 write(*,*) NF_STRERROR(ierr) 584 endif 585 endif 586 587 call gather(phy_bil,phy_glo) 588 if (is_mpi_root.and.is_omp_root) then 589 #ifdef NC_DOUBLE 590 ierr=NF_PUT_VAR_DOUBLE(nid,id_BILS,phy_glo) 591 #else 592 ierr=NF_PUT_VAR_REAL(nid,id_BILS,phy_glo) 593 #endif 594 if(ierr.ne.NF_NOERR) then 595 write(*,*) "writelim error with phy_bil" 596 write(*,*) NF_STRERROR(ierr) 597 endif 598 endif 599 600 call gather(phy_alb,phy_glo) 601 if (is_mpi_root.and.is_omp_root) then 602 #ifdef NC_DOUBLE 603 ierr=NF_PUT_VAR_DOUBLE(nid,id_ALB,phy_glo) 604 #else 605 ierr=NF_PUT_VAR_REAL(nid,id_ALB,phy_glo) 606 #endif 607 if(ierr.ne.NF_NOERR) then 608 write(*,*) "writelim error with phy_alb" 609 write(*,*) NF_STRERROR(ierr) 610 endif 611 endif 612 613 call gather(phy_rug,phy_glo) 614 if (is_mpi_root.and.is_omp_root) then 615 #ifdef NC_DOUBLE 616 ierr=NF_PUT_VAR_DOUBLE(nid,id_RUG,phy_glo) 617 #else 618 ierr=NF_PUT_VAR_REAL(nid,id_RUG,phy_glo) 619 #endif 620 if(ierr.ne.NF_NOERR) then 621 write(*,*) "writelim error with phy_rug" 622 write(*,*) NF_STRERROR(ierr) 623 endif 624 endif 625 626 call gather(phy_fter,phy_glo) 627 if (is_mpi_root.and.is_omp_root) then 628 #ifdef NC_DOUBLE 629 ierr=NF_PUT_VAR_DOUBLE(nid,id_FTER,phy_glo) 630 #else 631 ierr=NF_PUT_VAR_REAL(nid,id_FTER,phy_glo) 632 #endif 633 if(ierr.ne.NF_NOERR) then 634 write(*,*) "writelim error with phy_fter" 635 write(*,*) NF_STRERROR(ierr) 636 endif 637 endif 638 639 call gather(phy_foce,phy_glo) 640 if (is_mpi_root.and.is_omp_root) then 641 #ifdef NC_DOUBLE 642 ierr=NF_PUT_VAR_DOUBLE(nid,id_FOCE,phy_glo) 643 #else 644 ierr=NF_PUT_VAR_REAL(nid,id_FOCE,phy_glo) 645 #endif 646 if(ierr.ne.NF_NOERR) then 647 write(*,*) "writelim error with phy_foce" 648 write(*,*) NF_STRERROR(ierr) 649 endif 650 endif 651 652 call gather(phy_fsic,phy_glo) 653 if (is_mpi_root.and.is_omp_root) then 654 #ifdef NC_DOUBLE 655 ierr=NF_PUT_VAR_DOUBLE(nid,id_FSIC,phy_glo) 656 #else 657 ierr=NF_PUT_VAR_REAL(nid,id_FSIC,phy_glo) 658 #endif 659 if(ierr.ne.NF_NOERR) then 660 write(*,*) "writelim error with phy_fsic" 661 write(*,*) NF_STRERROR(ierr) 662 endif 663 endif 664 665 call gather(phy_flic,phy_glo) 666 if (is_mpi_root.and.is_omp_root) then 667 #ifdef NC_DOUBLE 668 ierr=NF_PUT_VAR_DOUBLE(nid,id_FLIC,phy_glo) 669 #else 670 ierr=NF_PUT_VAR_REAL(nid,id_FLIC,phy_glo) 671 #endif 672 if(ierr.ne.NF_NOERR) then 673 write(*,*) "writelim error with phy_flic" 674 write(*,*) NF_STRERROR(ierr) 675 endif 676 endif 677 678 ! close file: 679 if (is_mpi_root.and.is_omp_root) then 680 ierr = NF_CLOSE(nid) 681 endif 682 570 683 end 684 685 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 571 686 572 687 SUBROUTINE profil_sst(nlon, rlatd, type_profil, phy_sst) -
LMDZ5/branches/testing/libf/phylmd/phyetat0.F
r1665 r1707 76 76 c FH1D 77 77 c real iolat(jjm+1) 78 real iolat(jjm+1-1/ iim)78 real iolat(jjm+1-1/(iim*jjm)) 79 79 c 80 80 c Ouvrir le fichier contenant l'etat initial: -
LMDZ5/branches/testing/libf/phylmd/phys_output_mod.F90
r1669 r1707 81 81 type(ctrl_out),save :: o_sicf = ctrl_out((/ 1, 1, 10, 10, 10, 10 /),'sicf') 82 82 type(ctrl_out),save :: o_q2m = ctrl_out((/ 1, 1, 1, 5, 10, 10 /),'q2m') 83 type(ctrl_out),save :: o_ustar = ctrl_out((/ 1, 1, 1, 5, 10, 10 /),'ustar') 83 84 type(ctrl_out),save :: o_u10m = ctrl_out((/ 1, 1, 1, 5, 10, 10 /),'u10m') 84 85 type(ctrl_out),save :: o_v10m = ctrl_out((/ 1, 1, 1, 5, 10, 10 /),'v10m') … … 86 87 type(ctrl_out),save :: o_qsurf = ctrl_out((/ 1, 10, 10, 10, 10, 10 /),'qsurf') 87 88 89 type(ctrl_out),save,dimension(4) :: o_ustar_srf = (/ ctrl_out((/ 10, 6, 10, 10, 10, 10 /),'ustar_ter'), & 90 ctrl_out((/ 10, 6, 10, 10, 10, 10 /),'ustar_lic'), & 91 ctrl_out((/ 10, 6, 10, 10, 10, 10 /),'ustar_oce'), & 92 ctrl_out((/ 10, 6, 10, 10, 10, 10 /),'ustar_sic') /) 88 93 type(ctrl_out),save,dimension(4) :: o_u10m_srf = (/ ctrl_out((/ 10, 6, 10, 10, 10, 10 /),'u10m_ter'), & 89 94 ctrl_out((/ 10, 6, 10, 10, 10, 10 /),'u10m_lic'), & … … 585 590 586 591 type(ctrl_out),save,allocatable :: o_trac(:) 592 type(ctrl_out),save,allocatable :: o_trac_cum(:) 587 593 588 594 type(ctrl_out),save :: o_rsu = ctrl_out((/ 4, 10, 10, 10, 10, 10 /),'rsu') … … 719 725 720 726 if (.not. allocated(o_trac)) ALLOCATE(o_trac(nqtot)) 727 if (.not. allocated(o_trac_cum)) ALLOCATE(o_trac_cum(nqtot)) 721 728 722 729 levmax = (/ klev, klev, klev, klev, klev, klev /) … … 960 967 CALL histdef2d(iff,clef_stations(iff),o_sicf%flag,o_sicf%name, "Sea-ice fraction", "-" ) 961 968 CALL histdef2d(iff,clef_stations(iff),o_q2m%flag,o_q2m%name, "Specific humidity 2m", "kg/kg") 969 CALL histdef2d(iff,clef_stations(iff),o_ustar%flag,o_ustar%name, "Friction velocity", "m/s" ) 962 970 CALL histdef2d(iff,clef_stations(iff),o_u10m%flag,o_u10m%name, "Vent zonal 10m", "m/s" ) 963 971 CALL histdef2d(iff,clef_stations(iff),o_v10m%flag,o_v10m%name, "Vent meridien 10m", "m/s") … … 969 977 endif 970 978 979 type_ecri(1) = 'inst(X)' 980 type_ecri(2) = 'inst(X)' 981 type_ecri(3) = 'inst(X)' 982 type_ecri(4) = 'inst(X)' 983 type_ecri(5) = 'inst(X)' 984 type_ecri(6) = 'inst(X)' 971 985 CALL histdef2d(iff,clef_stations(iff),o_ndayrain%flag,o_ndayrain%name, "Number of dayrain(liq+sol)", "-") 986 type_ecri(:) = type_ecri_files(:) 972 987 CALL histdef2d(iff,clef_stations(iff),o_precip%flag,o_precip%name, "Precip Totale liq+sol", "kg/(s*m2)" ) 973 988 CALL histdef2d(iff,clef_stations(iff),o_plul%flag,o_plul%name, "Large-scale Precip.", "kg/(s*m2)") … … 1027 1042 o_tsol_srf(nsrf)%flag,o_tsol_srf(nsrf)%name,"Temperature "//clnsurf(nsrf),"K") 1028 1043 CALL histdef2d(iff,clef_stations(iff), & 1044 o_ustar_srf(nsrf)%flag,o_ustar_srf(nsrf)%name,"Friction velocity "//clnsurf(nsrf),"m/s") 1045 CALL histdef2d(iff,clef_stations(iff), & 1029 1046 o_u10m_srf(nsrf)%flag,o_u10m_srf(nsrf)%name,"Vent Zonal 10m "//clnsurf(nsrf),"m/s") 1030 1047 CALL histdef2d(iff,clef_stations(iff), & … … 1756 1773 o_trac(iq-2) = ctrl_out((/ 4, 5, 1, 1, 1, 10 /),tname(iiq)) 1757 1774 CALL histdef3d (iff,clef_stations(iff), & 1758 o_trac(iq-2)%flag,o_trac(iq-2)%name,'Tracer '//ttext(iiq), "-" ) 1775 o_trac(iq-2)%flag,o_trac(iq-2)%name,'Tracer '//ttext(iiq), "-" ) 1776 o_trac_cum(iq-2) = ctrl_out((/ 3, 4, 10, 10, 10, 10 /),'cum'//tname(iiq)) 1777 CALL histdef2d (iff,clef_stations(iff), & 1778 o_trac_cum(iq-2)%flag,o_trac_cum(iq-2)%name,'Cumulated tracer '//ttext(iiq), "-" ) 1759 1779 ENDDO 1760 1780 ENDIF -
LMDZ5/branches/testing/libf/phylmd/phys_output_write.h
r1669 r1707 101 101 CALL histwrite_phy(nid_files(iff),clef_stations(iff), 102 102 $o_q2m%name,itau_w,zq2m) 103 ENDIF 104 105 IF (o_ustar%flag(iff)<=lev_files(iff)) THEN 106 CALL histwrite_phy(nid_files(iff),clef_stations(iff), 107 $o_ustar%name,itau_w,zustar) 103 108 ENDIF 104 109 … … 437 442 $ zx_tmp_fi2d) 438 443 ENDIF 444 445 IF (o_ustar_srf(nsrf)%flag(iff)<=lev_files(iff)) THEN 446 zx_tmp_fi2d(1 : klon) = ustar(1 : klon, nsrf) 447 CALL histwrite_phy(nid_files(iff),clef_stations(iff), 448 $o_ustar_srf(nsrf)%name, 449 $ itau_w,zx_tmp_fi2d) 450 ENDIF 439 451 440 452 IF (o_u10m_srf(nsrf)%flag(iff)<=lev_files(iff)) THEN … … 2248 2260 ENDIF 2249 2261 ENDDO 2262 DO iq=3,nqtot 2263 IF (o_trac_cum(iq-2)%flag(iff)<=lev_files(iff)) THEN 2264 zx_tmp_fi2d=0. 2265 do k=1,klev 2266 zx_tmp_fi2d(:)=zx_tmp_fi2d(:)+zmasse(:,k)*qx(:,k,iq) 2267 enddo 2268 CALL histwrite_phy(nid_files(iff),clef_stations(iff), 2269 s o_trac_cum(iq-2)%name,itau_w,zx_tmp_fi2d) 2270 2271 ENDIF 2272 ENDDO 2250 2273 endif 2251 2274 -
LMDZ5/branches/testing/libf/phylmd/phys_state_var_mod.F90
r1669 r1707 326 326 REAL,SAVE,ALLOCATABLE :: newsst(:) 327 327 !$OMP THREADPRIVATE(newsst) 328 REAL,SAVE,ALLOCATABLE :: u 10m(:,:), v10m(:,:)329 !$OMP THREADPRIVATE(u 10m,v10m)328 REAL,SAVE,ALLOCATABLE :: ustar(:,:),u10m(:,:), v10m(:,:) 329 !$OMP THREADPRIVATE(ustar,u10m,v10m) 330 330 ! 331 331 ! ok_ade=T -ADE=topswad-topsw … … 496 496 ALLOCATE(rlonPOS(klon)) 497 497 ALLOCATE(newsst(klon)) 498 ALLOCATE(u 10m(klon,nbsrf), v10m(klon,nbsrf))498 ALLOCATE(ustar(klon,nbsrf),u10m(klon,nbsrf), v10m(klon,nbsrf)) 499 499 ALLOCATE(topswad(klon), solswad(klon)) 500 500 ALLOCATE(topswai(klon), solswai(klon)) … … 606 606 deallocate(rlonPOS) 607 607 deallocate(newsst) 608 deallocate(u 10m, v10m)608 deallocate(ustar,u10m, v10m) 609 609 deallocate(topswad, solswad) 610 610 deallocate(topswai, solswai) -
LMDZ5/branches/testing/libf/phylmd/physiq.F
r1669 r1707 178 178 save iflag_ratqs 179 179 c$OMP THREADPRIVATE(iflag_ratqs) 180 real facteur ,zfratqs1,zfratqs2180 real facteur 181 181 182 182 REAL zz,znum,zden … … 257 257 c variables a une pression donnee 258 258 c 259 real rlevSTD(nlevSTD) 260 DATA rlevSTD/100000., 92500., 85000., 70000., 261 .60000., 50000., 40000., 30000., 25000., 20000., 262 .15000., 10000., 7000., 5000., 3000., 2000., 1000./ 263 SAVE rlevstd 264 c$OMP THREADPRIVATE(rlevstd) 265 CHARACTER*4 clevSTD(nlevSTD) 266 DATA clevSTD/'1000','925 ','850 ','700 ','600 ', 267 .'500 ','400 ','300 ','250 ','200 ','150 ','100 ', 268 .'70 ','50 ','30 ','20 ','10 '/ 269 SAVE clevSTD 270 c$OMP THREADPRIVATE(clevSTD) 259 #include "declare_STDlev.h" 271 260 c 272 261 CHARACTER*4 bb2 273 262 CHARACTER*2 bb3 274 275 real twriteSTD(klon,nlevSTD,nfiles)276 real qwriteSTD(klon,nlevSTD,nfiles)277 real rhwriteSTD(klon,nlevSTD,nfiles)278 real phiwriteSTD(klon,nlevSTD,nfiles)279 real uwriteSTD(klon,nlevSTD,nfiles)280 real vwriteSTD(klon,nlevSTD,nfiles)281 real wwriteSTD(klon,nlevSTD,nfiles)282 cIM for NMC files283 REAL geo500(klon)284 real :: rlevSTD3(nlevSTD3)285 DATA rlevSTD3/85000., 50000., 25000./286 SAVE rlevSTD3287 c$OMP THREADPRIVATE(rlevSTD3)288 real :: rlevSTD8(nlevSTD8)289 DATA rlevSTD8/100000., 85000., 70000., 50000., 25000., 10000.,290 $ 5000., 1000./291 SAVE rlevSTD8292 c$OMP THREADPRIVATE(rlevSTD8)293 real twriteSTD3(klon,nlevSTD3)294 real qwriteSTD3(klon,nlevSTD3)295 real rhwriteSTD3(klon,nlevSTD3)296 real phiwriteSTD3(klon,nlevSTD3)297 real uwriteSTD3(klon,nlevSTD3)298 real vwriteSTD3(klon,nlevSTD3)299 real wwriteSTD3(klon,nlevSTD3)300 c301 real tnondefSTD8(klon,nlevSTD8)302 real twriteSTD8(klon,nlevSTD8)303 real qwriteSTD8(klon,nlevSTD8)304 real rhwriteSTD8(klon,nlevSTD8)305 real phiwriteSTD8(klon,nlevSTD8)306 real uwriteSTD8(klon,nlevSTD8)307 real vwriteSTD8(klon,nlevSTD8)308 real wwriteSTD8(klon,nlevSTD8)309 c310 c plevSTD3 END311 c312 c nout : niveau de output des variables a une pression donnee313 logical oknondef(klon,nlevSTD,nout)314 c315 c les produits uvSTD, vqSTD, .., T2STD sont calcules316 c a partir des valeurs instantannees toutes les 6 h317 c qui sont moyennees sur le mois318 263 c 319 264 #include "radopt.h" … … 958 903 REAL snow_lsc(klon) 959 904 c 960 REAL ratqs s(klon,klev),ratqsc(klon,klev)905 REAL ratqsc(klon,klev) 961 906 real ratqsbas,ratqshaut,tau_ratqs 962 907 save ratqsbas,ratqshaut,tau_ratqs … … 1050 995 REAL zx_tmp_fi3d(klon,klev) ! variable temporaire pour champs 3D 1051 996 REAL zx_tmp_fi3d1(klon,klev+1) !variable temporaire pour champs 3D (kelvp1) 1052 c#ifdef histNMC1053 cym A voir plus tard !!!!1054 cym REAL zx_tmp_NC(iim,jjmp1,nlevSTD)1055 REAL zx_tmp_fiNC(klon,nlevSTD)1056 c#endif1057 997 REAL(KIND=8) zx_tmp2_fi3d(klon,klev) ! variable temporaire pour champs 3D 1058 998 REAL zx_tmp_2d(iim,jjmp1), zx_tmp_3d(iim,jjmp1,klev) 1059 999 REAL zx_lon(iim,jjmp1), zx_lat(iim,jjmp1) 1060 cIM for NMC files1061 REAL missing_val1062 REAL, SAVE :: freq_moyNMC(nout)1063 c$OMP THREADPRIVATE(freq_moyNMC)1064 1000 c 1065 1001 INTEGER nid_day, nid_mth, nid_ins, nid_mthnmc, nid_daynmc … … 1137 1073 REAL q2m(klon,nbsrf) ! humidite a 2m 1138 1074 1139 cIM: t2m, q2m, u 10m, v10m et t2mincels, t2maxcels1075 cIM: t2m, q2m, ustar, u10m, v10m et t2mincels, t2maxcels 1140 1076 REAL zt2m(klon), zq2m(klon) !temp., hum. 2m moyenne s/ 1 maille 1141 REAL zu 10m(klon), zv10m(klon) !vents a 10m moyennes s/1 maille1077 REAL zustar(klon),zu10m(klon), zv10m(klon) ! u* et vents a 10m moyennes s/1 maille 1142 1078 CHARACTER*40 t2mincels, t2maxcels !t2m min., t2m max 1143 1079 CHARACTER*40 tinst, tave, typeval … … 1255 1191 integer iostat 1256 1192 1257 cIM for NMC files1258 missing_val=nf90_fill_real1259 1193 c====================================================================== 1260 1194 ! Gestion calendrier : mise a jour du module phys_cal_mod … … 1326 1260 call phys_output_var_init 1327 1261 print*, '=================================================' 1328 cIM for NMC files 1329 cIM freq_moyNMC = frequences auxquelles on moyenne les champs accumules 1330 cIM sur les niveaux de pression standard du NMC 1331 DO n=1, nout 1332 freq_moyNMC(n)=freq_outNMC(n)/freq_calNMC(n) 1333 ENDDO 1334 c 1335 cIM beg 1262 c 1336 1263 dnwd0=0.0 1337 1264 ftd=0.0 … … 1381 1308 lalim_conv(:)=1 1382 1309 cRC 1310 ustar(:,:)=0. 1383 1311 u10m(:,:)=0. 1384 1312 v10m(:,:)=0. … … 1768 1696 ! 1769 1697 CALL change_srf_frac(itap, dtime, days_elapsed+1, 1770 * pctsrf, falb1, falb2, ftsol, u 10m, v10m, pbl_tke)1698 * pctsrf, falb1, falb2, ftsol, ustar, u10m, v10m, pbl_tke) 1771 1699 1772 1700 … … 2078 2006 e t_seri, q_seri, u_seri, v_seri, 2079 2007 e pplay, paprs, pctsrf, 2080 + ftsol, falb1, falb2, u 10m, v10m,2008 + ftsol, falb1, falb2, ustar, u10m, v10m, 2081 2009 s sollwdown, cdragh, cdragm, u1, v1, 2082 2010 s albsol1, albsol2, sens, evap, … … 2087 2015 d s_capCL, s_oliqCL, s_cteiCL,s_pblT, 2088 2016 d s_therm, s_trmb1, s_trmb2, s_trmb3, 2089 d zxrugs, zu 10m, zv10m, fder,2017 d zxrugs, zustar, zu10m, zv10m, fder, 2090 2018 d zxqsurf, rh2m, zxfluxu, zxfluxv, 2091 2019 d frugs, agesno, fsollw, fsolsw, … … 2816 2744 2817 2745 c------------------------------------------------------------------------- 2818 c Caclul des ratqs 2819 c------------------------------------------------------------------------- 2820 2821 c print*,'calcul des ratqs' 2822 c ratqs convectifs a l'ancienne en fonction de q(z=0)-q / q 2823 c ---------------- 2824 c on ecrase le tableau ratqsc calcule par clouds_gno 2825 if (iflag_cldcon.eq.1) then 2826 do k=1,klev 2827 do i=1,klon 2828 if(ptconv(i,k)) then 2829 ratqsc(i,k)=ratqsbas 2830 s +fact_cldcon*(q_seri(i,1)-q_seri(i,k))/q_seri(i,k) 2831 else 2832 ratqsc(i,k)=0. 2833 endif 2834 enddo 2835 enddo 2836 2837 c----------------------------------------------------------------------- 2838 c par nversion de la fonction log normale 2839 c----------------------------------------------------------------------- 2840 else if (iflag_cldcon.eq.4) then 2841 ptconvth(:,:)=.false. 2842 ratqsc(:,:)=0. 2843 if(prt_level.ge.9) print*,'avant clouds_gno thermique' 2844 call clouds_gno 2845 s (klon,klev,q_seri,zqsat,clwcon0th,ptconvth,ratqsc,rnebcon0th) 2846 if(prt_level.ge.9) print*,' CLOUDS_GNO OK' 2847 2848 endif 2849 2850 c ratqs stables 2851 c ------------- 2852 2853 if (iflag_ratqs.eq.0) then 2854 2855 ! Le cas iflag_ratqs=0 correspond a la version IPCC 2005 du modele. 2856 do k=1,klev 2857 do i=1, klon 2858 ratqss(i,k)=ratqsbas+(ratqshaut-ratqsbas)* 2859 s min((paprs(i,1)-pplay(i,k))/(paprs(i,1)-30000.),1.) 2860 enddo 2861 enddo 2862 2863 ! Pour iflag_ratqs=1 ou 2, le ratqs est constant au dessus de 2864 ! 300 hPa (ratqshaut), varie lineariement en fonction de la pression 2865 ! entre 600 et 300 hPa et est soit constant (ratqsbas) pour iflag_ratqs=1 2866 ! soit lineaire (entre 0 a la surface et ratqsbas) pour iflag_ratqs=2 2867 ! Il s'agit de differents tests dans la phase de reglage du modele 2868 ! avec thermiques. 2869 2870 else if (iflag_ratqs.eq.1) then 2871 2872 do k=1,klev 2873 do i=1, klon 2874 if (pplay(i,k).ge.60000.) then 2875 ratqss(i,k)=ratqsbas 2876 else if ((pplay(i,k).ge.30000.).and. 2877 s (pplay(i,k).lt.60000.)) then 2878 ratqss(i,k)=ratqsbas+(ratqshaut-ratqsbas)* 2879 s (60000.-pplay(i,k))/(60000.-30000.) 2880 else 2881 ratqss(i,k)=ratqshaut 2882 endif 2883 enddo 2884 enddo 2885 2886 else if (iflag_ratqs.eq.2) then 2887 2888 do k=1,klev 2889 do i=1, klon 2890 if (pplay(i,k).ge.60000.) then 2891 ratqss(i,k)=ratqsbas 2892 s *(paprs(i,1)-pplay(i,k))/(paprs(i,1)-60000.) 2893 else if ((pplay(i,k).ge.30000.).and. 2894 s (pplay(i,k).lt.60000.)) then 2895 ratqss(i,k)=ratqsbas+(ratqshaut-ratqsbas)* 2896 s (60000.-pplay(i,k))/(60000.-30000.) 2897 else 2898 ratqss(i,k)=ratqshaut 2899 endif 2900 enddo 2901 enddo 2902 2903 else if (iflag_ratqs==3) then 2904 do k=1,klev 2905 ratqss(:,k)=ratqsbas+(ratqshaut-ratqsbas) 2906 s *min( ((paprs(:,1)-pplay(:,k))/70000.)**2 , 1. ) 2907 enddo 2908 2909 else if (iflag_ratqs==4) then 2910 do k=1,klev 2911 ratqss(:,k)=ratqsbas+0.5*(ratqshaut-ratqsbas) 2912 s *( tanh( (50000.-pplay(:,k))/20000.) + 1.) 2913 enddo 2914 2915 endif 2916 2917 2918 2919 2920 c ratqs final 2921 c ----------- 2922 2923 if (iflag_cldcon.eq.1 .or.iflag_cldcon.eq.2 2924 s .or.iflag_cldcon.eq.4) then 2925 2926 ! On ajoute une constante au ratqsc*2 pour tenir compte de 2927 ! fluctuations turbulentes de petite echelle 2928 2929 do k=1,klev 2930 do i=1,klon 2931 if ((fm_therm(i,k).gt.1.e-10)) then 2932 ratqsc(i,k)=sqrt(ratqsc(i,k)**2+0.05**2) 2933 endif 2934 enddo 2935 enddo 2936 2937 ! les ratqs sont une combinaison de ratqss et ratqsc 2938 if(prt_level.ge.9) 2939 $ write(lunout,*)'PHYLMD NOUVEAU TAU_RATQS ',tau_ratqs 2940 2941 if (tau_ratqs>1.e-10) then 2942 facteur=exp(-pdtphys/tau_ratqs) 2943 else 2944 facteur=0. 2945 endif 2946 ratqs(:,:)=ratqsc(:,:)*(1.-facteur)+ratqs(:,:)*facteur 2947 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 2948 ! FH 22/09/2009 2949 ! La ligne ci-dessous faisait osciller le modele et donnait une solution 2950 ! assymptotique bidon et dépendant fortement du pas de temps. 2951 ! ratqs(:,:)=sqrt(ratqs(:,:)**2+ratqss(:,:)**2) 2952 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 2953 ratqs(:,:)=max(ratqs(:,:),ratqss(:,:)) 2954 else if (iflag_cldcon<=6) then 2955 ! on ne prend que le ratqs stable pour fisrtilp 2956 ratqs(:,:)=ratqss(:,:) 2957 else 2958 zfratqs1=exp(-pdtphys/10800.) 2959 zfratqs2=exp(-pdtphys/10800.) 2960 ! print*,'RAPPEL RATQS 1 ',zfratqs1,zfratqs2 2961 ! s ,ratqss(1,14),ratqs(1,14),ratqsc(1,14) 2962 do k=1,klev 2963 do i=1,klon 2964 if (ratqsc(i,k).gt.1.e-10) then 2965 ratqs(i,k)=ratqs(i,k)*zfratqs2 2966 s +(iflag_cldcon/100.)*ratqsc(i,k)*(1.-zfratqs2) 2967 endif 2968 ratqs(i,k)=min(ratqs(i,k)*zfratqs1 2969 s +ratqss(i,k)*(1.-zfratqs1),0.5) 2970 enddo 2971 enddo 2972 endif 2746 ! Computation of ratqs, the width (normalized) of the subrid scale 2747 ! water distribution 2748 CALL calcratqs(klon,klev,prt_level,lunout, 2749 s iflag_ratqs,iflag_con,iflag_cldcon,pdtphys, 2750 s ratqsbas,ratqshaut,tau_ratqs,fact_cldcon, 2751 s ptconv,ptconvth,clwcon0th, rnebcon0th, 2752 s paprs,pplay,q_seri,zqsat,fm_therm, 2753 s ratqs,ratqsc) 2973 2754 2974 2755 … … 3843 3624 I cdragh, coefh, fm_therm, entr_therm, 3844 3625 I u1, v1, ftsol, pctsrf, 3626 I ustar, u10m, v10m, 3845 3627 I rlat, frac_impa, frac_nucl,rlon, 3846 3628 I presnivs, pphis, pphi, albsol1, … … 3933 3715 c 3934 3716 #include "calcul_STDlev.h" 3935 twriteSTD(:,:,1)=tsumSTD(:,:,1)3936 qwriteSTD(:,:,1)=qsumSTD(:,:,1)3937 rhwriteSTD(:,:,1)=rhsumSTD(:,:,1)3938 phiwriteSTD(:,:,1)=phisumSTD(:,:,1)3939 uwriteSTD(:,:,1)=usumSTD(:,:,1)3940 vwriteSTD(:,:,1)=vsumSTD(:,:,1)3941 wwriteSTD(:,:,1)=wsumSTD(:,:,1)3942 3943 twriteSTD(:,:,2)=tsumSTD(:,:,2)3944 qwriteSTD(:,:,2)=qsumSTD(:,:,2)3945 rhwriteSTD(:,:,2)=rhsumSTD(:,:,2)3946 phiwriteSTD(:,:,2)=phisumSTD(:,:,2)3947 uwriteSTD(:,:,2)=usumSTD(:,:,2)3948 vwriteSTD(:,:,2)=vsumSTD(:,:,2)3949 wwriteSTD(:,:,2)=wsumSTD(:,:,2)3950 3951 twriteSTD(:,:,3)=tlevSTD(:,:)3952 qwriteSTD(:,:,3)=qlevSTD(:,:)3953 rhwriteSTD(:,:,3)=rhlevSTD(:,:)3954 phiwriteSTD(:,:,3)=philevSTD(:,:)3955 uwriteSTD(:,:,3)=ulevSTD(:,:)3956 vwriteSTD(:,:,3)=vlevSTD(:,:)3957 wwriteSTD(:,:,3)=wlevSTD(:,:)3958 3959 twriteSTD(:,:,4)=tlevSTD(:,:)3960 qwriteSTD(:,:,4)=qlevSTD(:,:)3961 rhwriteSTD(:,:,4)=rhlevSTD(:,:)3962 phiwriteSTD(:,:,4)=philevSTD(:,:)3963 uwriteSTD(:,:,4)=ulevSTD(:,:)3964 vwriteSTD(:,:,4)=vlevSTD(:,:)3965 wwriteSTD(:,:,4)=wlevSTD(:,:)3966 c3967 cIM initialisation 5eme fichier de sortie3968 twriteSTD(:,:,5)=tlevSTD(:,:)3969 qwriteSTD(:,:,5)=qlevSTD(:,:)3970 rhwriteSTD(:,:,5)=rhlevSTD(:,:)3971 phiwriteSTD(:,:,5)=philevSTD(:,:)3972 uwriteSTD(:,:,5)=ulevSTD(:,:)3973 vwriteSTD(:,:,5)=vlevSTD(:,:)3974 wwriteSTD(:,:,5)=wlevSTD(:,:)3975 c3976 cIM initialisation 6eme fichier de sortie3977 twriteSTD(:,:,6)=tlevSTD(:,:)3978 qwriteSTD(:,:,6)=qlevSTD(:,:)3979 rhwriteSTD(:,:,6)=rhlevSTD(:,:)3980 phiwriteSTD(:,:,6)=philevSTD(:,:)3981 uwriteSTD(:,:,6)=ulevSTD(:,:)3982 vwriteSTD(:,:,6)=vlevSTD(:,:)3983 wwriteSTD(:,:,6)=wlevSTD(:,:)3984 cIM for NMC files3985 DO n=1, nlevSTD33986 DO k=1, nlevSTD3987 if(rlevSTD3(n).EQ.rlevSTD(k)) THEN3988 twriteSTD3(:,n)=tlevSTD(:,k)3989 qwriteSTD3(:,n)=qlevSTD(:,k)3990 rhwriteSTD3(:,n)=rhlevSTD(:,k)3991 phiwriteSTD3(:,n)=philevSTD(:,k)3992 uwriteSTD3(:,n)=ulevSTD(:,k)3993 vwriteSTD3(:,n)=vlevSTD(:,k)3994 wwriteSTD3(:,n)=wlevSTD(:,k)3995 endif !rlevSTD3(n).EQ.rlevSTD(k)3996 ENDDO3997 ENDDO3998 c3999 DO n=1, nlevSTD84000 DO k=1, nlevSTD4001 if(rlevSTD8(n).EQ.rlevSTD(k)) THEN4002 tnondefSTD8(:,n)=tnondef(:,k,2)4003 twriteSTD8(:,n)=tsumSTD(:,k,2)4004 qwriteSTD8(:,n)=qsumSTD(:,k,2)4005 rhwriteSTD8(:,n)=rhsumSTD(:,k,2)4006 phiwriteSTD8(:,n)=phisumSTD(:,k,2)4007 uwriteSTD8(:,n)=usumSTD(:,k,2)4008 vwriteSTD8(:,n)=vsumSTD(:,k,2)4009 wwriteSTD8(:,n)=wsumSTD(:,k,2)4010 endif !rlevSTD8(n).EQ.rlevSTD(k)4011 ENDDO4012 ENDDO4013 3717 c 4014 3718 c slp sea level pressure -
LMDZ5/branches/testing/libf/phylmd/phytrac.F90
r1665 r1707 8 8 cdragh, coefh, fm_therm, entr_therm,& 9 9 yu1, yv1, ftsol, pctsrf, & 10 ustar, u10m, v10m, & 10 11 xlat, frac_impa,frac_nucl,xlon, & 11 12 presnivs, pphis, pphi, albsol, & … … 119 120 !-------------- 120 121 ! 121 REAL,DIMENSION(klon),INTENT(IN) :: cdragh ! coeff drag pour T et Q 122 REAL,DIMENSION(klon,klev),INTENT(IN) :: coefh ! coeff melange CL (m**2/s) 123 REAL,DIMENSION(klon),INTENT(IN) :: yu1 ! vents au premier niveau 124 REAL,DIMENSION(klon),INTENT(IN) :: yv1 ! vents au premier niveau 122 REAL,DIMENSION(klon),INTENT(IN) :: cdragh ! coeff drag pour T et Q 123 REAL,DIMENSION(klon,klev),INTENT(IN):: coefh ! coeff melange CL (m**2/s) 124 REAL,DIMENSION(klon),INTENT(IN) :: ustar,u10m,v10m ! u* & vent a 10m (m/s) 125 REAL,DIMENSION(klon),INTENT(IN) :: yu1 ! vents au premier niveau 126 REAL,DIMENSION(klon),INTENT(IN) :: yv1 ! vents au premier niveau 125 127 ! 126 128 !Lessivage: … … 244 246 ! -- Traitement des traceurs avec traclmdz 245 247 CALL traclmdz(nstep, julien, gmtime, pdtphys, t_seri, paprs, pplay, & 246 cdragh, coefh, yu1, yv1, ftsol, pctsrf, xlat, xlon, couchelimite, & 247 sh, tr_seri, source, solsym, d_tr_cl, zmasse) 248 cdragh, coefh, yu1, yv1, ftsol, pctsrf, xlat, xlon,couchelimite,sh,& 249 rh, pphi, ustar, u10m, v10m, & 250 tr_seri, source, solsym, d_tr_cl, zmasse) 248 251 CASE('inca') 249 252 ! -- CHIMIE INCA config_inca = aero or chem -- -
LMDZ5/branches/testing/libf/phylmd/printflag.F
r1403 r1707 87 87 ! radpas0 = NINT( 86400./tabcntr0(1)/INT( tabcntr0(6) ) ) 88 88 PRINT 100 89 PRINT 22, radpas0, radpas89 ! PRINT 22, radpas0, radpas 90 90 PRINT 100 91 91 ENDIF -
LMDZ5/branches/testing/libf/phylmd/traclmdz_mod.F90
r1665 r1707 279 279 SUBROUTINE traclmdz(nstep, julien, gmtime, pdtphys, t_seri, paprs, pplay, & 280 280 cdragh, coefh, yu1, yv1, ftsol, pctsrf, xlat, xlon, couchelimite, sh, & 281 rh, pphi, ustar, zu10m, zv10m, & 281 282 tr_seri, source, solsym, d_tr_cl, zmasse) 282 283 … … 315 316 !-------------- 316 317 ! 317 REAL,DIMENSION(klon),INTENT(IN) :: cdragh 318 REAL,DIMENSION(klon,klev),INTENT(IN) :: coefh ! coeff melange CL(m**2/s)319 REAL,DIMENSION(klon),INTENT(IN) :: yu1 320 REAL,DIMENSION(klon),INTENT(IN) :: yv1 318 REAL,DIMENSION(klon),INTENT(IN) :: cdragh ! coeff drag pour T et Q 319 REAL,DIMENSION(klon,klev),INTENT(IN) :: coefh ! diffusivite turb (m**2/s) 320 REAL,DIMENSION(klon),INTENT(IN) :: yu1 ! vents au premier niveau 321 REAL,DIMENSION(klon),INTENT(IN) :: yv1 ! vents au premier niveau 321 322 LOGICAL,INTENT(IN) :: couchelimite 322 REAL,DIMENSION(klon,klev),INTENT(IN) :: sh ! humidite specifique 323 REAL,DIMENSION(klon,klev),INTENT(IN) :: sh ! humidite specifique 324 REAL,DIMENSION(klon,klev),INTENT(IN) :: rh ! Humidite relative 325 REAL,DIMENSION(klon,klev),INTENT(IN) :: pphi ! geopotentie 326 REAL,DIMENSION(klon),INTENT(IN) :: ustar ! ustar (m/s) 327 REAL,DIMENSION(klon),INTENT(IN) :: zu10m ! vent zonal 10m (m/s) 328 REAL,DIMENSION(klon),INTENT(IN) :: zv10m ! vent zonal 10m (m/s) 323 329 324 330 ! Arguments necessaires pour les sources et puits de traceur: -
LMDZ5/branches/testing/makegcm
r1669 r1707 52 52 # 53 53 # 54 setenv IOIPSLDIR / d4/fairhead/LMDZ20100928.trunk/modipsl/lib55 setenv MODIPSLDIR / d4/fairhead/LMDZ20100928.trunk/modipsl/lib56 setenv NCDFINC / d3/idelkadi/MODELE_LMDZ/LMDZ20121005.trunk/netcdf-4.0.1/include57 setenv NCDFLIB / d3/idelkadi/MODELE_LMDZ/LMDZ20121005.trunk/netcdf-4.0.1/lib54 setenv IOIPSLDIR /tmpdir/fairhead/Aqua/LMDZ20120327.trunk/modipsl/lib 55 setenv MODIPSLDIR /tmpdir/fairhead/Aqua/LMDZ20120327.trunk/modipsl/lib 56 setenv NCDFINC /tmpdir/fairhead/Aqua/LMDZ20120327.trunk/netcdf-4.0.1/include 57 setenv NCDFLIB /tmpdir/fairhead/Aqua/LMDZ20120327.trunk/netcdf-4.0.1/lib 58 58 59 59 … … 149 149 set machine=ALPHA 150 150 set DEC=1 151 else if ( `uname` == Linux && `hostname` != mercure && `hostname` != brodie ) then151 else if ( `uname` == Linux || `uname` == Darwin && `hostname` != mercure && `hostname` != brodie ) then 152 152 set machine=LINUX 153 153 set LINUX=1 … … 843 843 else if ($FC_LINUX == 'g95' || $FC_LINUX == 'gfortran' ) then 844 844 if ( $io == "ioipsl" ) then 845 set opt_link="$opt_link -L$MODIPSLDIR $link_veget -lioipsl -L$NCDFLIB -lnetcdf -lioipsl-lnetcdf "845 set opt_link="$opt_link -L$MODIPSLDIR $link_veget -lioipsl -L$NCDFLIB -lnetcdff -lnetcdf -lioipsl -lnetcdff -lnetcdf " 846 846 else 847 set opt_link="$opt_link -L$MODIPSLDIR $link_veget -lioipsl -L$NCDFLIB -lnetcdf -lnetcdf "847 set opt_link="$opt_link -L$MODIPSLDIR $link_veget -lioipsl -L$NCDFLIB -lnetcdff -lnetcdf " 848 848 endif 849 849 endif … … 963 963 set make="make RANLIB=ls" 964 964 else if $LINUX then 965 set make="make - kRANLIB=ranlib"965 set make="make -S RANLIB=ranlib" 966 966 else if $XNEC then 967 967 set make="gmake RANLIB=ls" -
LMDZ5/branches/testing/makelmdz
r1551 r1707 1 1 #!/bin/bash 2 2 # 3 # $Id 3 # $Id$ 4 4 # 5 5 # … … 19 19 chimie=false 20 20 parallel=none 21 paramem="par" 21 22 compil_mod=prod 22 23 io=ioipsl … … 26 27 27 28 # guess a default 'arch' 28 arch=" g95" # start with assuming we're on a Linux/Unix machine with g9529 arch="local" # start with assuming we're on a local machine with local arch file 29 30 ## try to recognise machine and infer arch from it 30 31 machine=`hostname` … … 113 114 [-cpp CPP_KEY] : cle cpp supplementaires 114 115 [-adjnt] : adjoint, a remettre en route ... 116 [-mem] : version memoire reduite (si en mode parallele) 115 117 [-filtre NOMFILTRE] : prend le filtre dans libf/NOMFILTRE (def: filtrez) 116 118 [-link LINKS] : liens optionels avec d autres librairies … … 170 172 "-cosp") 171 173 cosp="$2" ; shift ; shift ;; 174 175 "-mem") 176 paramem="mem" ; shift ;; 172 177 173 178 "-filtre") … … 273 278 if [[ "$physique" != "nophys" ]] 274 279 then 275 #Default planet type is Earth 280 #We'll use some physics 281 CPP_KEY="$CPP_KEY CPP_PHYS" 282 if [[ "${physique:0:3}" == "lmd" ]] 283 then 284 #For lmd physics, default planet type is Earth 276 285 CPP_KEY="$CPP_KEY CPP_EARTH" 286 fi 277 287 fi 278 288 … … 387 397 ######################################################################## 388 398 399 cd $LIBFGCM/grid 400 if [[ -f dimensions.h ]] 401 then 402 echo 'ATTENTION: vous etes sans doute en train de compiler le modele par ailleurs' 403 echo "Attendez que la premiere compilation soit terminee pour relancer la suivante." 404 echo "Si vous etes sur que vous ne compilez pas le modele par ailleurs," 405 echo vous pouvez continuer en repondant oui. 406 echo "Voulez-vous vraiment continuer?" 407 read reponse 408 if [[ $reponse == "oui" ]] 409 then 410 \rm -f $LIBFGCM/grid/dimensions.h 411 else 412 exit 413 fi 414 fi 415 416 389 417 cd $LIBFGCM/grid/dimension 390 418 ./makdim $dim … … 435 463 then 436 464 SUFF_NAME=${SUFF_NAME}_para 437 DYN=dyn${dimc}dpar 465 DYN=dyn${dimc}d${paramem} 466 if [[ "$paramem" == "mem" ]] 467 then 468 SUFF_NAME=${SUFF_NAME}_${paramem} 469 fi 438 470 else 439 471 SUFF_NAME=${SUFF_NAME}_seq … … 600 632 PROG=$code 601 633 602 if [[ -r $ libf/grid/dimensions.h ]]634 if [[ -r $LIBFGCM/grid/dimensions.h ]] 603 635 then 604 636 # Cleanup: remove dimension.h file 605 \rm -f $ libf/grid/dimensions.h606 fi 637 \rm -f $LIBFGCM/grid/dimensions.h 638 fi -
LMDZ5/branches/testing/makelmdz_fcm
r1665 r1707 24 24 chimie=false 25 25 parallel=none 26 paramem="par" 26 27 compil_mod=prod 27 28 io=ioipsl … … 72 73 [-cpp CPP_KEY] : cle cpp supplementaires 73 74 [-adjnt] : adjoint, a remettre en route ... 75 [-mem] : version memoire reduite (si en mode parallele) 74 76 [-filtre NOMFILTRE] : prend le filtre dans libf/NOMFILTRE (def: filtrez) 75 77 [-link LINKS] : liens optionels avec d'autres librairies … … 125 127 126 128 "-adjnt") 127 echo "o tpion a reactiver ";exit129 echo "option a reactiver ";exit 128 130 opt_dep="$opt_dep adjnt" ; adjnt="-ladjnt -ldyn3d " 129 131 optim="$optim -Dadj" ; shift ;; … … 131 133 "-cosp") 132 134 cosp="$2" ; shift ; shift ;; 133 135 136 "-mem") 137 paramem="mem" ; shift ;; 134 138 135 139 "-filtre") … … 278 282 # on cree ou remplace le fichier des dimensions 279 283 ######################################################################## 284 285 cd $LIBFGCM/grid 286 if [[ -f dimensions.h ]] 287 then 288 echo 'ATTENTION: vous etes sans doute en train de compiler le modele par ailleurs' 289 echo "Attendez que la premiere compilation soit terminee pour relancer la suivante." 290 echo "Si vous etes sur que vous ne compilez pas le modele par ailleurs," 291 echo vous pouvez continuer en repondant oui. 292 echo "Voulez-vous vraiment continuer?" 293 read reponse 294 if [[ $reponse == "oui" ]] 295 then 296 \rm -f $LIBFGCM/grid/dimensions.h 297 else 298 exit 299 fi 300 fi 301 280 302 281 303 cd $LIBFGCM/grid/dimension … … 349 371 then 350 372 SUFF_NAME=${SUFF_NAME}_para 351 DYN=dyn${dimc}dpar 373 DYN=dyn${dimc}d${paramem} 374 if [[ "$paramem" == "mem" ]] 375 then 376 SUFF_NAME=${SUFF_NAME}_${paramem} 377 fi 352 378 else 353 379 SUFF_NAME=${SUFF_NAME}_seq … … 413 439 ln -s $LIBOGCM/${arch}${SUFF_NAME}/.config config 414 440 ln -s $LIBOGCM/${arch}${SUFF_NAME}/.config/tmp tmp_src 441 442 if [[ -r $LIBFGCM/grid/dimensions.h ]] 443 then 444 # Cleanup: remove dimension.h file 445 \rm -f $LIBFGCM/grid/dimensions.h 446 fi
Note: See TracChangeset
for help on using the changeset viewer.