Changeset 1454 for LMDZ5/trunk/libf/dyn3dpar/friction_p.F
- Timestamp:
- Nov 18, 2010, 1:01:24 PM (14 years ago)
- Location:
- LMDZ5/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ5/trunk
- Property svn:mergeinfo changed
/LMDZ5/branches/LMDZ5V1.0-dev (added) merged: 1436-1438,1441-1449,1452-1453
- Property svn:mergeinfo changed
-
LMDZ5/trunk/libf/dyn3dpar/friction_p.F
r1403 r1454 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(out) :: ucov( iip1,jjp1,llm ) 37 REAL,INTENT(out) :: vcov( iip1,jjm,llm ) 38 REAL,INTENT(in) :: pdt ! time step 39 40 ! local variables: 28 41 REAL modv(iip1,jjp1),zco,zsi 29 42 REAL vpn,vps,upoln,upols,vpols,vpoln 30 43 REAL u2(iip1,jjp1),v2(iip1,jjm) 31 REAL ucov( iip1,jjp1,llm ),vcov( iip1,jjm,llm ) 32 INTEGER i,j 33 REAL cfric 34 parameter (cfric=1.e-5) 44 INTEGER i,j,l 45 REAL,PARAMETER :: cfric=1.e-5 46 LOGICAL,SAVE :: firstcall=.true. 47 INTEGER,SAVE :: friction_type=1 48 CHARACTER(len=20) :: modname="friction_p" 49 CHARACTER(len=80) :: abort_message 50 !$OMP THREADPRIVATE(firstcall,friction_type) 35 51 integer :: jjb,jje 36 52 37 53 !$OMP SINGLE 54 IF (firstcall) THEN 55 ! set friction type 56 call getin("friction_type",friction_type) 57 if ((friction_type.lt.0).or.(friction_type.gt.1)) then 58 abort_message="wrong friction type" 59 write(lunout,*)'Friction: wrong friction type',friction_type 60 call abort_gcm(modname,abort_message,42) 61 endif 62 firstcall=.false. 63 ENDIF 64 !$OMP END SINGLE COPYPRIVATE(friction_type,firstcall) 65 66 if (friction_type.eq.0) then ! friction on first layer only 67 !$OMP SINGLE 38 68 c calcul des composantes au carre du vent naturel 39 69 jjb=jj_begin … … 138 168 vcov(iip1,j,1)=vcov(1,j,1) 139 169 enddo 170 !$OMP END SINGLE 171 endif ! of if (friction_type.eq.0) 172 173 if (friction_type.eq.1) then 174 ! for ucov() 175 jjb=jj_begin 176 jje=jj_end 177 if (pole_nord) jjb=jj_begin+1 178 if (pole_sud) jje=jj_end-1 179 180 !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 181 do l=1,llm 182 ucov(1:iip1,jjb:jje,l)=ucov(1:iip1,jjb:jje,l)* 183 & (1.-pdt*kfrict(l)) 184 enddo 185 !$OMP END DO NOWAIT 186 187 ! for vcoc() 188 jjb=jj_begin 189 jje=jj_end 190 if (pole_sud) jje=jj_end-1 191 192 !$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 193 do l=1,llm 194 vcov(1:iip1,jjb:jje,l)=vcov(1:iip1,jjb:jje,l)* 195 & (1.-pdt*kfrict(l)) 196 enddo 197 !$OMP END DO 198 endif ! of if (friction_type.eq.1) 140 199 141 200 RETURN
Note: See TracChangeset
for help on using the changeset viewer.