/[MITgcm]/MITgcm/pkg/generic_advdiff/gad_dst3_adv_r.F
ViewVC logotype

Contents of /MITgcm/pkg/generic_advdiff/gad_dst3_adv_r.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1.4.1 - (show annotations) (download)
Mon Apr 8 20:10:39 2002 UTC (22 years, 1 month ago) by heimbach
Branch: release1
CVS Tags: release1_p13_pre, release1_p13, release1_p8, release1_p9, release1_p1, release1_p2, release1_p3, release1_p4, release1_p5, release1_p6, release1_p7, release1_chkpt44d_post, release1_p11, release1_p12, release1_p10, release1_p16, release1_p17, release1_p14, release1_p15, release1_p12_pre
Branch point for: release1_50yr
Changes since 1.1: +6 -6 lines
Changes encapsulated by checkpoint43a-release1mods and chkpt44d_post
on the main trunk.
These are:

 o added missing EXCLUDE_MONITOR flags
 o changed "e" to "_d" in gmredi_slope_limit, gmredi_slope_psi
   (incompatible typ in MIN/MAX expressions caused problems
   on IBM SP3)
 o in genmake added variable MAKEDEPEND
   plus resetting for case SunOS
 o added timer_stats.c routine for IBM SP3
 o removed variables in dynamics
 o real fresh water flux implemented with non-linear free-surface.
 o few fix (mask in shap_s2, EmPmR in external_field_load,
   USE_NATURAL_BCS in solve_for_P);
 o add arguments myIter & myTime to S/R obcs_calc & solve_for_P
 o merge of relevant stuff from the ecco-branch:
   - genmake: removed $S64 overwrite for case SunOS
   - pkg/exf: update and corrections for field swapping and obcs
   - pkg/ecco: parameter lists for the_model_main, the_main_loop
               harmonized between ECCO and MITgcm
   - pkg/autodiff: added flow directives for obcs, mdsio_gl_slice
                   updated checkpointing_lev... lists for obcs
   - model/src: minor changes in forward_step, plot_field
                added directive for divided adjoint in the_main_loop
   - pkg/mdsio: added mdsio_gl_slice
 o check parameters & config (chkpt44a_pre,post)
 o OBC and NonLin_FrSurf.
 o fix bug in mom_vi_del2uv
 o select when filters are applied ; add options to zonal_filter (data.zonfilt)
 o gmredi: fix Pb in the adiabatic form ; add options (.e.g. Bolus advection)
 o update AIM experiments (NCEP input files)
 o improve and extend diagnostics (Monitor, TimeAve with NonLin-FrSurf)
 o added some stuff for AD

These were merged with
cvs co -r release1 -P MITgcm
cd MITgcm
cvs update -kk
cvs update -j checkpoint43a-release1mods -j chkpt44d_post -d -P -kk

1 C $Header$
2 C $Name$
3
4 #include "GAD_OPTIONS.h"
5
6 SUBROUTINE GAD_DST3_ADV_R(
7 I bi_arg,bj_arg,k,dTarg,
8 I rTrans, wVel,
9 I tracer,
10 O wT,
11 I myThid )
12 C /==========================================================\
13 C | SUBROUTINE GAD_DST3_ADV_R |
14 C | o Compute Vertical advective Flux of Tracer using |
15 C | 3rd Order DST Sceheme |
16 C |==========================================================|
17 IMPLICIT NONE
18
19 C == GLobal variables ==
20 #include "SIZE.h"
21 #include "GRID.h"
22 #include "EEPARAMS.h"
23 #include "PARAMS.h"
24 #include "GAD.h"
25
26 C == Routine arguments ==
27 INTEGER bi_arg,bj_arg,k
28 _RL dTarg
29 _RL rTrans(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
30 _RL wVel(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
31 _RL tracer(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
32 _RL wT (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
33 INTEGER myThid
34
35 C == Local variables ==
36 INTEGER i,j,kp1,km1,km2,bi,bj
37 _RL Rjm,Rj,Rjp,cfl,d0,d1
38 _RL psiP,psiM,thetaP,thetaM
39
40 IF (.NOT. multiDimAdvection) THEN
41 C If using the standard time-stepping/advection schemes (ie. AB-II)
42 C then the data-structures are all global arrays
43 bi=bi_arg
44 bj=bj_arg
45 ELSE
46 C otherwise if using the multi-dimensional advection schemes
47 C then the data-structures are all local arrays except
48 C for maskC(...) and wVel(...)
49 bi=1
50 bj=1
51 ENDIF
52
53 km2=MAX(1,k-2)
54 km1=MAX(1,k-1)
55 kp1=MIN(Nr,k+1)
56
57 DO j=1-Oly,sNy+Oly
58 DO i=1-Olx,sNx+Olx
59 Rjp=(tracer(i,j,k,bi,bj)-tracer(i,j,kp1,bi,bj))
60 & *maskC(i,j,kp1,bi_arg,bj_arg)
61 Rj =(tracer(i,j,km1,bi,bj)-tracer(i,j,k,bi,bj))
62 & *maskC(i,j,k,bi_arg,bj_arg)*maskC(i,j,km1,bi_arg,bj_arg)
63 Rjm=(tracer(i,j,km2,bi,bj)-tracer(i,j,km1,bi,bj))
64 & *maskC(i,j,km1,bi_arg,bj_arg)
65
66 cfl=abs(wVel(i,j,k,bi_arg,bj_arg)*dTarg*recip_drc(k))
67 d0=(2.-cfl)*(1.-cfl)*oneSixth
68 d1=(1.-cfl*cfl)*oneSixth
69 c thetaP=0.
70 c IF (Rj.NE.0.) thetaP=Rjm/Rj
71 thetaP=Rjm/(1.D-20+Rj)
72 psiP=d0+d1*thetaP
73 c psiP=max(0.,min(min(1.,psiP),(1.-cfl)/(1.D-20+cfl)*thetaP))
74 thetaM=Rjp/(1.D-20+Rj)
75 c thetaM=0.
76 c IF (Rj.NE.0.) thetaM=Rjp/Rj
77 psiM=d0+d1*thetaM
78 c psiM=max(0.,min(min(1.,psiM),(1.-cfl)/(1.D-20+cfl)*thetaM))
79 wT(i,j)=
80 & 0.5*(rTrans(i,j)+abs(rTrans(i,j)))
81 & *( Tracer(i,j, k ,bi,bj) + psiM*Rj )
82 & +0.5*(rTrans(i,j)-abs(rTrans(i,j)))
83 & *( Tracer(i,j,km1,bi,bj) - psiP*Rj )
84
85 ENDDO
86 ENDDO
87
88 RETURN
89 END

  ViewVC Help
Powered by ViewVC 1.1.22