[38] | 1 | SUBROUTINE calldrag_noro(ngrid,nlayer,ptimestep, |
---|
| 2 | & pplay,pplev,pt,pu,pv,pdtgw,pdugw,pdvgw) |
---|
| 3 | |
---|
| 4 | |
---|
| 5 | |
---|
[1047] | 6 | use surfdat_h, only: zstd, zsig, zgam, zthe |
---|
| 7 | use dimradmars_mod, only: ndomainsz |
---|
[38] | 8 | IMPLICIT NONE |
---|
| 9 | c======================================================================= |
---|
| 10 | c subject: |
---|
| 11 | c -------- |
---|
| 12 | c Subroutine designed to call SUBROUTINE drag_noro |
---|
| 13 | c Interface for sub-grid scale orographic scheme |
---|
| 14 | c The purpose of this subroutine is |
---|
| 15 | c 1) Make some initial calculation at first call |
---|
| 16 | c 2) Split the calculation in several sub-grid |
---|
| 17 | c ("sub-domain") to save memory and |
---|
| 18 | c be able run on a workstation at high resolution |
---|
[1047] | 19 | c The sub-grid size is defined in dimradmars_mod. |
---|
[38] | 20 | c |
---|
| 21 | c author: |
---|
| 22 | c ------ |
---|
| 23 | c Christophe Hourdin/ Francois Forget |
---|
| 24 | c |
---|
| 25 | c changes: |
---|
| 26 | c ------- |
---|
| 27 | c > J.-B. Madeleine 10W12 |
---|
| 28 | c This version uses the variable's splitting, which can be usefull |
---|
| 29 | c when performing very high resolution simulation like LES. |
---|
| 30 | c |
---|
| 31 | c input: |
---|
| 32 | c ----- |
---|
| 33 | c ngrid number of gridpoint of horizontal grid |
---|
| 34 | c nlayer Number of layer |
---|
| 35 | c ptimestep Physical timestep (s) |
---|
| 36 | c pplay(ngrid,nlayer) pressure (Pa) in the middle of each layer |
---|
| 37 | c pplev(ngrid,nlayer+1) pressure (Pa) at boundaries of each layer |
---|
| 38 | c pt(ngrid,nlayer) atmospheric temperature (K) |
---|
| 39 | c pu(ngrid,nlayer) zonal wind (m s-1) |
---|
| 40 | c pv(ngrid,nlayer) meridional wind (m s-1) |
---|
| 41 | c |
---|
| 42 | c output: |
---|
| 43 | c ------- |
---|
| 44 | c pdtgw(ngrid,nlayer) Temperature trend (K.s-1) |
---|
| 45 | c pdugw(ngrid,nlayer) zonal wind trend (m.s-2) |
---|
| 46 | c pdvgw(ngrid,nlayer) meridional wind trend (m.s-2) |
---|
| 47 | c |
---|
| 48 | c |
---|
| 49 | c |
---|
| 50 | c |
---|
| 51 | c |
---|
| 52 | c======================================================================= |
---|
| 53 | c |
---|
| 54 | c 0. Declarations : |
---|
| 55 | c ------------------ |
---|
| 56 | c |
---|
[1047] | 57 | !#include "dimensions.h" |
---|
| 58 | !#include "dimphys.h" |
---|
| 59 | !#include "dimradmars.h" |
---|
| 60 | !#include "surfdat.h" |
---|
[38] | 61 | |
---|
| 62 | c----------------------------------------------------------------------- |
---|
| 63 | c Input/Output |
---|
| 64 | c ------------ |
---|
| 65 | INTEGER ngrid,nlayer |
---|
| 66 | |
---|
| 67 | real ptimestep |
---|
| 68 | |
---|
| 69 | REAL pplev(ngrid,nlayer+1),pplay(ngrid,nlayer) |
---|
| 70 | REAL pt(ngrid,nlayer), pu(ngrid,nlayer),pv(ngrid,nlayer) |
---|
| 71 | REAL pdtgw(ngrid,nlayer), pdugw(ngrid,nlayer),pdvgw(ngrid,nlayer) |
---|
| 72 | |
---|
| 73 | |
---|
| 74 | c |
---|
| 75 | c Local variables : |
---|
| 76 | c ----------------- |
---|
| 77 | |
---|
[1047] | 78 | REAL sigtest(nlayer+1) |
---|
| 79 | INTEGER igwd,igwdim,itest(ngrid) |
---|
[38] | 80 | |
---|
[1047] | 81 | INTEGER,SAVE :: ndomain |
---|
| 82 | ! parameter (ndomain = (ngrid-1) / ndomainsz + 1) |
---|
[38] | 83 | |
---|
| 84 | INTEGER l,ig |
---|
| 85 | INTEGER jd,ig0,nd |
---|
| 86 | |
---|
[1047] | 87 | REAL zulow(ngrid),zvlow(ngrid) |
---|
| 88 | REAL zustr(ngrid),zvstr(ngrid) |
---|
[38] | 89 | |
---|
[1047] | 90 | REAL zplev(ndomainsz,nlayer+1) |
---|
| 91 | REAL zplay(ndomainsz,nlayer) |
---|
| 92 | REAL zt(ndomainsz,nlayer) |
---|
| 93 | REAL zu(ndomainsz,nlayer) |
---|
| 94 | REAL zv(ndomainsz,nlayer) |
---|
[38] | 95 | INTEGER zidx(ndomainsz) |
---|
[1047] | 96 | REAL zzdtgw(ndomainsz,nlayer) |
---|
| 97 | REAL zzdugw(ndomainsz,nlayer) |
---|
| 98 | REAL zzdvgw(ndomainsz,nlayer) |
---|
[38] | 99 | |
---|
| 100 | logical ll |
---|
| 101 | |
---|
| 102 | |
---|
| 103 | c local saved variables |
---|
| 104 | c --------------------- |
---|
| 105 | |
---|
| 106 | LOGICAL firstcall |
---|
| 107 | DATA firstcall/.true./ |
---|
| 108 | SAVE firstcall |
---|
| 109 | |
---|
| 110 | |
---|
| 111 | c---------------------------------------------------------------------- |
---|
| 112 | |
---|
| 113 | c Initialisation |
---|
| 114 | c -------------- |
---|
| 115 | |
---|
| 116 | IF (firstcall) THEN |
---|
[1047] | 117 | ndomain = (ngrid-1) / ndomainsz + 1 |
---|
| 118 | |
---|
| 119 | do l=1,nlayer+1 |
---|
[38] | 120 | sigtest(l)=pplev(1,l)/pplev(1,1) |
---|
| 121 | enddo |
---|
[1047] | 122 | call sugwd(nlayer,sigtest) |
---|
[38] | 123 | |
---|
[1047] | 124 | if (ngrid .EQ. 1) then |
---|
[38] | 125 | if (ndomainsz .NE. 1) then |
---|
| 126 | print* |
---|
| 127 | print*,'ATTENTION !!!' |
---|
| 128 | print*,'pour tourner en 1D, meme pour drag_noro ' |
---|
[1047] | 129 | print*,'fixer ndomainsz=1 dans phymars/dimradmars_mod' |
---|
[38] | 130 | print* |
---|
| 131 | call exit(1) |
---|
| 132 | endif |
---|
| 133 | endif |
---|
| 134 | |
---|
| 135 | firstcall=.false. |
---|
| 136 | END IF |
---|
| 137 | |
---|
| 138 | c Starting loop on sub-domain |
---|
| 139 | c ---------------------------- |
---|
| 140 | |
---|
| 141 | DO jd=1,ndomain |
---|
| 142 | ig0=(jd-1)*ndomainsz |
---|
| 143 | if (jd.eq.ndomain) then |
---|
[1047] | 144 | nd=ngrid-ig0 |
---|
[38] | 145 | else |
---|
| 146 | nd=ndomainsz |
---|
| 147 | endif |
---|
| 148 | |
---|
| 149 | c Detecting points concerned by the scheme |
---|
| 150 | c ---------------------------------------- |
---|
| 151 | |
---|
| 152 | igwd=0 |
---|
| 153 | DO ig=ig0+1,ig0+nd |
---|
| 154 | itest(ig)=0 |
---|
| 155 | ll=zstd(ig).gt.50.0 |
---|
| 156 | IF(ll) then |
---|
| 157 | itest(ig)=1 |
---|
| 158 | igwd=igwd+1 |
---|
| 159 | zidx(igwd)=ig - ig0 |
---|
| 160 | ENDIF |
---|
| 161 | ENDDO |
---|
| 162 | IGWDIM=MAX(1,IGWD) |
---|
| 163 | |
---|
| 164 | c Spliting input variable in sub-domain input variables |
---|
| 165 | c --------------------------------------------------- |
---|
| 166 | |
---|
| 167 | do l=1,nlayer+1 |
---|
| 168 | do ig = 1,nd |
---|
| 169 | zplev(ig,l) = pplev(ig0+ig,l) |
---|
| 170 | enddo |
---|
| 171 | enddo |
---|
| 172 | |
---|
| 173 | do l=1,nlayer |
---|
| 174 | do ig = 1,nd |
---|
| 175 | zplay(ig,l) = pplay(ig0+ig,l) |
---|
| 176 | zt(ig,l) = pt(ig0+ig,l) |
---|
| 177 | zu(ig,l) = pu(ig0+ig,l) |
---|
| 178 | zv(ig,l) = pv(ig0+ig,l) |
---|
| 179 | enddo |
---|
| 180 | enddo |
---|
| 181 | |
---|
| 182 | c Calling gravity wave and subgrid scale topo parameterization |
---|
| 183 | c ------------------------------------------------------------- |
---|
| 184 | |
---|
| 185 | call drag_noro (nd,nlayer,ptimestep,zplay,zplev, |
---|
| 186 | e zstd(ig0+1),zsig(ig0+1),zgam(ig0+1),zthe(ig0+1), |
---|
| 187 | e igwd,igwdim,zidx,itest(ig0+1), |
---|
| 188 | e zt, zu, zv, |
---|
| 189 | s zulow(ig0+1),zvlow(ig0+1),zustr(ig0+1),zvstr(ig0+1), |
---|
| 190 | s zzdtgw,zzdugw,zzdvgw) |
---|
| 191 | |
---|
| 192 | c Un-spliting output variable from sub-domain input variables |
---|
| 193 | c ------------------------------------------------------------ |
---|
| 194 | c (and devide by ptimestep -> true tendancies) |
---|
| 195 | |
---|
| 196 | do l=1,nlayer |
---|
| 197 | do ig = 1,nd |
---|
| 198 | pdtgw(ig0+ig,l) = zzdtgw(ig,l)/ptimestep |
---|
| 199 | pdugw(ig0+ig,l) = zzdugw(ig,l)/ptimestep |
---|
| 200 | pdvgw(ig0+ig,l) = zzdvgw(ig,l)/ptimestep |
---|
| 201 | enddo |
---|
| 202 | enddo |
---|
| 203 | |
---|
| 204 | ENDDO ! (boucle jd=1, ndomain) |
---|
| 205 | |
---|
| 206 | return |
---|
| 207 | end |
---|
| 208 | |
---|