OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
hump.f
Go to the documentation of this file.
1  subroutine hump(const,t,tp,nm,lp,rmu,thd,ixy,nmu)
2 c
3 c***********************************************************************
4  implicit real*8(a-h,o-z)
5  parameter(nw=250,nth=46,nsz=45,nph=91,nsg=10,nstk=4,ntrx=16,npti=8,
6  1 nlyr=200,ntf=1801,nwnd=8,nrhum=10,nmd=3)
7  real*8 yy,xx,const,lp
8  real*8 t(ntf,nstk),am(nlyr),costh(nlyr),sinth(nlyr),p(nstk,nstk)
9  real*8 tp(nlyr,nstk),cthr(nlyr),thr(nlyr),dmu(nlyr),rmu(51),thd(ntf)
10 c***********************************************************************
11 c program to compute pbar for each mup when mu=mup and delfi=0
12 c
13  izia=0
14 c write(6,*)'entering hump'
15  pi=dacos(-1.0d0 )
16  conv =pi/180.0d0
17  p(:,:)=0.0d0
18  dp=0.10d0
19  dt=0.10d0
20  fi1=lp/2
21  ni1=fi1/dp+1
22  dp=fi1/dfloat(ni1)
23  do k=1,ni1
24  fk=dfloat(k-1)*dp
25  if(ixy.ne.0) then
26  phi=(180-fi1+fk+dp/2.0d0)*conv
27  else
28  phi=(fk+dp/2.0d0)*conv
29  endif
30  sinth(k) = dsin(phi)
31  costh(k) = dcos(phi)
32  enddo
33  deldeg=dt
34  do kl=1,nm/2
35  deg=rmu(kl+1)-rmu(kl)
36  nodeg=deg/deldeg
37  deldeg=deg/dfloat(nodeg)
38  nodp1=nodeg+1
39  xx=deg/2.0d0
40  yy=xx-deldeg/2.0d0
41  thetd=(rmu(kl)+rmu(kl+1))/2.0d0
42  amup = dcos(thetd*conv)
43  do i=1,nodp1
44  fi=dfloat(i-1)*deldeg
45  cthr(i)=(thetd-xx+fi)*conv
46  enddo
47  do i=1,nodeg
48  fi=dfloat(i-1)*deldeg
49  thr(i)=(thetd-yy+fi)*conv
50  am(i) = dcos(thr(i))
51  dmu(i)=dcos(cthr(i))-dcos(cthr(i+1))
52  enddo
53  ddmu =dcos(rmu(kl)*conv)-dcos(rmu(kl+1)*conv)
54  amups=amup**2
55  do i=1,4
56  k=(kl-1)*4+i
57  do j=1,4
58  tp(k,j)=0.0d0
59  enddo
60  enddo
61  do i=1,nodeg
62  if(ixy.ne.0) then
63  amu=-am(i)
64  else
65  amu=am(i)
66  endif
67  p(:,:)=0.0d0
68  amusq=amu**2
69  amumu=amu*amup
70  anunu = dsqrt((1.0d0-amups)*(1.0d0-amusq))
71  do j=1,ni1
72  siin=sinth(j)
73  coosn=costh(j)
74  copsi=anunu+amumu*coosn
75  sifi=copsi*coosn
76  sfisq=siin**2
77  cfisq=coosn**2
78  sisq=copsi**2
79  a=amup*coosn
80  b=amup*copsi
81  c=amu*coosn
82  d=amu*copsi
83  e=sfisq*(amusq+amups)
84  g=amumu*sfisq
85  h=sfisq*(amusq-amups)
86  x=amumu+anunu*coosn
87  yz= dacos(x)/conv
88  yzz=10.0d0*yz
89  m=idint(yzz)+1
90  if(m.eq.0)m=1
91  ya=yz-thd(m)
92  dthd=thd(m)-thd(m+1)
93  call xntpln(yz,thd(m),thd(m+1),t(m,1),t(m+1,1),t1)
94  call xntpln(yz,thd(m),thd(m+1),t(m,2),t(m+1,2),t2)
95  call xntpln(yz,thd(m),thd(m+1),t(m,3),t(m+1,3),t3)
96  call xntpln(yz,thd(m),thd(m+1),t(m,4),t(m+1,4),t4)
97  p(3,3)=p(3,3)+(sifi-g)*(t1+t2)+(cfisq+sisq-e)*t3
98  p(2,2)=p(2,2)+sisq*t1+cfisq*t2+2.0d0 *sifi * t3
99  p(1,2)=p(1,2)+sfisq*(amups*t1+amusq*t2+2.0d0 * amumu *t3 )
100  p(2,1)=p(2,1)+sfisq*(amups*t2+amusq*t1+2.0d0 * amumu *t3)
101  p(1,1)=p(1,1)+cfisq*t1+sisq*t2+2.0d0 * sifi *t3
102  p(4,3)=p(4,3)+(sisq-cfisq-h)*t4
103  p(3,4)=p(3,4)+(cfisq-sisq-h)*t4
104  p(4,4)=p(4,4)+(sifi+g)*(t1+t2)+(cfisq+sisq+e)*t3
105  enddo
106  do k=1,4
107  kk=(kl-1)*4+k
108  do l=1,4
109  ttpp1=const*p(k,1)*dmu(i)*dp/fi1
110  ttpp2=const*p(k,2)*dmu(i)*dp/fi1
111  ttpp=0.5d0*(ttpp1+ttpp2)
112  tp(kk,l)=p(k,l)*dmu(i)*dp/fi1+tp(kk,l)
113  km=kk-(kl-1)*4
114  enddo
115  enddo
116  enddo
117  do k=1,4
118  kk=(kl-1)*4+k
119  do l=1,4
120  tp(kk,l)=tp(kk,l)/ddmu
121  enddo
122  enddo
123  id=(kl-1)*4
124  ppbar=const*(tp(id+1,1)+tp(id+1,2)+tp(id+2,1)+tp(id+2,2))*0.5d0
125  enddo
126  if(izia.eq.1)stop
127 c***********************************************************************
128 c***********************************************************************
129  return
130  end
131 c***********************************************************************
subroutine hump(const, t, tp, nm, lp, rmu, thd, ixy, nmu)
Definition: hump.f:2
#define real
Definition: DbAlgOcean.cpp:26
subroutine const(NGAUSS, NMAX, MMAX, P, X, W, AN, ANN, S, SS, NP, EPS)
Definition: ampld.lp.f:924
README for MOD_PR03(V6.1.0) 2. POINTS OF CONTACT it can be either SDP Toolkit or MODIS Packet for Terra input files The orbit validation configuration parameter(LUN 600281) must be either "TRUE" or "FALSE". It needs to be "FALSE" when running in Near Real Time mode
subroutine xntpln(x, x1, x2, y1, y2, y)
Definition: xntpln.f:2
#define pi
Definition: vincenty.c:23