| 1 |
heimbach |
1.1 |
C $Header: /u/gcmpack/development/heimbach/div/c34_adj/pkg/ctrl/ctrl_map_ini.F,v 1.1.1.1 2001/02/13 17:55:14 heimbach Exp $ |
| 2 |
|
|
|
| 3 |
|
|
#include "CTRL_CPPOPTIONS.h" |
| 4 |
|
|
|
| 5 |
|
|
|
| 6 |
|
|
subroutine ctrl_map_ini( |
| 7 |
|
|
I mythid |
| 8 |
|
|
& ) |
| 9 |
|
|
|
| 10 |
|
|
c ================================================================== |
| 11 |
|
|
c SUBROUTINE ctrl_map_ini |
| 12 |
|
|
c ================================================================== |
| 13 |
|
|
c |
| 14 |
|
|
c o Add the temperature and salinity parts of the control vector to |
| 15 |
|
|
c the model state and update the tile edges. The control vector is |
| 16 |
|
|
c defined in the header file "ctrl.h". |
| 17 |
|
|
c |
| 18 |
|
|
c started: Christian Eckert eckert@mit.edu 30-Jun-1999 |
| 19 |
|
|
c |
| 20 |
|
|
c changed: Christian Eckert eckert@mit.edu 23-Feb-2000 |
| 21 |
|
|
c |
| 22 |
|
|
c - Restructured the code in order to create a package |
| 23 |
|
|
c for the MITgcmUV. |
| 24 |
|
|
c |
| 25 |
|
|
c ================================================================== |
| 26 |
|
|
c SUBROUTINE ctrl_map_ini |
| 27 |
|
|
c ================================================================== |
| 28 |
|
|
|
| 29 |
|
|
implicit none |
| 30 |
|
|
|
| 31 |
|
|
c == global variables == |
| 32 |
|
|
|
| 33 |
|
|
#include "EEPARAMS.h" |
| 34 |
|
|
#include "SIZE.h" |
| 35 |
|
|
#include "DYNVARS.h" |
| 36 |
|
|
|
| 37 |
|
|
#include "ctrl.h" |
| 38 |
|
|
#include "ctrl_dummy.h" |
| 39 |
|
|
|
| 40 |
|
|
c == routine arguments == |
| 41 |
|
|
|
| 42 |
|
|
integer mythid |
| 43 |
|
|
|
| 44 |
|
|
c == local variables == |
| 45 |
|
|
|
| 46 |
|
|
_RL fac |
| 47 |
|
|
integer bi,bj |
| 48 |
|
|
integer i,j,k |
| 49 |
|
|
integer itlo,ithi |
| 50 |
|
|
integer jtlo,jthi |
| 51 |
|
|
integer jmin,jmax |
| 52 |
|
|
integer imin,imax |
| 53 |
|
|
integer il |
| 54 |
|
|
|
| 55 |
|
|
logical equal |
| 56 |
|
|
logical doglobalread |
| 57 |
|
|
logical ladinit |
| 58 |
|
|
|
| 59 |
|
|
character*( 80) fnametheta |
| 60 |
|
|
character*( 80) fnamesalt |
| 61 |
|
|
|
| 62 |
|
|
c == external == |
| 63 |
|
|
|
| 64 |
|
|
integer ilnblnk |
| 65 |
|
|
external ilnblnk |
| 66 |
|
|
|
| 67 |
|
|
c == end of interface == |
| 68 |
|
|
|
| 69 |
|
|
jtlo = mybylo(mythid) |
| 70 |
|
|
jthi = mybyhi(mythid) |
| 71 |
|
|
itlo = mybxlo(mythid) |
| 72 |
|
|
ithi = mybxhi(mythid) |
| 73 |
|
|
jmin = 1-oly |
| 74 |
|
|
jmax = sny+oly |
| 75 |
|
|
imin = 1-olx |
| 76 |
|
|
imax = snx+olx |
| 77 |
|
|
|
| 78 |
|
|
doglobalread = .false. |
| 79 |
|
|
ladinit = .false. |
| 80 |
|
|
|
| 81 |
|
|
equal = .true. |
| 82 |
|
|
|
| 83 |
|
|
if ( equal ) then |
| 84 |
|
|
fac = 1. _d 0 |
| 85 |
|
|
else |
| 86 |
|
|
fac = 0. _d 0 |
| 87 |
|
|
endif |
| 88 |
|
|
|
| 89 |
|
|
#ifdef ALLOW_THETA0_CONTROL |
| 90 |
|
|
c-- Temperature field. |
| 91 |
|
|
il=ilnblnk( xx_theta_file ) |
| 92 |
|
|
write(fnametheta(1:80),'(2a,i10.10)') |
| 93 |
|
|
& xx_theta_file(1:il),'.',optimcycle |
| 94 |
|
|
call active_read_xyz( fnametheta, tmpfld3d, 1, |
| 95 |
|
|
& doglobalread, ladinit, optimcycle, |
| 96 |
|
|
& mythid, xx_theta_dummy ) |
| 97 |
|
|
|
| 98 |
|
|
do bj = jtlo,jthi |
| 99 |
|
|
do bi = itlo,ithi |
| 100 |
|
|
do k = 1,nr |
| 101 |
|
|
do j = jmin,jmax |
| 102 |
|
|
do i = imin,imax |
| 103 |
|
|
theta(i,j,k,bi,bj) = theta(i,j,k,bi,bj) + |
| 104 |
|
|
& fac*tmpfld3d(i,j,k,bi,bj) |
| 105 |
|
|
gtNm1(i,j,k,bi,bj) = gtNm1(i,j,k,bi,bj) + |
| 106 |
|
|
& fac*tmpfld3d(i,j,k,bi,bj) |
| 107 |
|
|
enddo |
| 108 |
|
|
enddo |
| 109 |
|
|
enddo |
| 110 |
|
|
enddo |
| 111 |
|
|
enddo |
| 112 |
|
|
#endif |
| 113 |
|
|
|
| 114 |
|
|
#ifdef ALLOW_SALT0_CONTROL |
| 115 |
|
|
c-- Temperature field. |
| 116 |
|
|
il=ilnblnk( xx_salt_file ) |
| 117 |
|
|
write(fnamesalt(1:80),'(2a,i10.10)') |
| 118 |
|
|
& xx_salt_file(1:il),'.',optimcycle |
| 119 |
|
|
call active_read_xyz( fnamesalt, tmpfld3d, 1, |
| 120 |
|
|
& doglobalread, ladinit, optimcycle, |
| 121 |
|
|
& mythid, xx_salt_dummy ) |
| 122 |
|
|
|
| 123 |
|
|
do bj = jtlo,jthi |
| 124 |
|
|
do bi = itlo,ithi |
| 125 |
|
|
do k = 1,nr |
| 126 |
|
|
do j = jmin,jmax |
| 127 |
|
|
do i = imin,imax |
| 128 |
|
|
salt(i,j,k,bi,bj) = salt(i,j,k,bi,bj) + |
| 129 |
|
|
& fac*tmpfld3d(i,j,k,bi,bj) |
| 130 |
|
|
gsNm1(i,j,k,bi,bj) = gsNm1(i,j,k,bi,bj) + |
| 131 |
|
|
& fac*tmpfld3d(i,j,k,bi,bj) |
| 132 |
|
|
enddo |
| 133 |
|
|
enddo |
| 134 |
|
|
enddo |
| 135 |
|
|
enddo |
| 136 |
|
|
enddo |
| 137 |
|
|
#endif |
| 138 |
|
|
|
| 139 |
|
|
|
| 140 |
|
|
c-- Update the tile edges. |
| 141 |
|
|
|
| 142 |
|
|
#ifdef ALLOW_THETA0_CONTROL |
| 143 |
|
|
_EXCH_XYZ_R8( theta, mythid ) |
| 144 |
|
|
_EXCH_XYZ_R8( gtNm1, mythid ) |
| 145 |
|
|
#endif |
| 146 |
|
|
#ifdef ALLOW_SALT0_CONTROL |
| 147 |
|
|
_EXCH_XYZ_R8( salt, mythid ) |
| 148 |
|
|
_EXCH_XYZ_R8( gsNm1, mythid ) |
| 149 |
|
|
#endif |
| 150 |
|
|
|
| 151 |
|
|
return |
| 152 |
|
|
end |
| 153 |
|
|
|