/[MITgcm]/MITgcm/pkg/exf/exf_set_lwflux.F
ViewVC logotype

Annotation of /MITgcm/pkg/exf/exf_set_lwflux.F

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


Revision 1.5 - (hide annotations) (download)
Thu Mar 6 00:47:33 2003 UTC (21 years, 2 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint50e_post, checkpoint50c_post, checkpoint50b_pre, checkpoint49, checkpoint50, checkpoint50d_pre, checkpoint50d_post, checkpoint50c_pre, checkpoint50b_post, checkpoint50a_post, checkpoint50f_pre, checkpoint50e_pre
Changes since 1.4: +1 -1 lines
merged from ecco-branch:
o exf:
  - Enable initialisation of forcing fields to constant
    (runtime) values.
  - in exf_getffields.F
    Reduce i-/j-loop to interior domain, discarding overlaps.
    That also fixes wrong TAF-key computations for key_1, key_2
    with bulf formulae.
  - exf_init.F modify #ifdef for exf_init_evap
  - exf_getffieldrec.F, ctrl_getrec.F
    The following INT-usages are not safe:
      fldsecs  = int(fldsecs/fldperiod)*fldperiod
      fldcount = int(fldsecs/fldperiod) + 1
    and were modified.

1 heimbach 1.1 #include "EXF_CPPOPTIONS.h"
2    
3 heimbach 1.2 subroutine exf_set_lwflux( mycurrenttime, mycurrentiter, mythid )
4 heimbach 1.1
5     c ==================================================================
6     c SUBROUTINE exf_set_lwflux
7     c ==================================================================
8     c
9     c o set external forcing lwflux
10     c
11     c started: Ralf.Giering@FastOpt.de 25-Mai-2000
12 heimbach 1.2 c changed: heimbach@mit.edu 10-Jan-2002
13 dimitri 1.4 c mods for pkg/seaice: menemenlis@jpl.nasa.gov 20-Dec-2002
14 heimbach 1.1
15     c ==================================================================
16     c SUBROUTINE exf_set_lwflux
17     c ==================================================================
18    
19     implicit none
20    
21     c == global variables ==
22    
23     #include "EEPARAMS.h"
24     #include "SIZE.h"
25     #include "GRID.h"
26    
27     #include "exf_param.h"
28     #include "exf_constants.h"
29 heimbach 1.2 #include "exf_fields.h"
30 heimbach 1.1
31     c == routine arguments ==
32    
33     _RL mycurrenttime
34     integer mycurrentiter
35     integer mythid
36    
37 heimbach 1.2 #ifdef ALLOW_ATM_TEMP
38 heimbach 1.1 c == local variables ==
39    
40     logical first, changed
41     integer count0, count1
42     _RL fac
43    
44     integer bi, bj
45     integer i, j
46    
47     c == end of interface ==
48    
49 dimitri 1.4 if ( lwfluxfile .NE. ' ' ) then
50    
51 heimbach 1.1 c get record numbers and interpolation factor for lwflux
52 dimitri 1.4 call exf_GetFFieldRec(
53     I lwfluxstartdate, lwfluxperiod
54     O , fac, first, changed
55     O , count0, count1
56     I , mycurrenttime, mycurrentiter, mythid
57     & )
58    
59     if ( first ) then
60     call mdsreadfield( lwfluxfile, exf_iprec, exf_yftype, 1
61     & , lwflux1, count0, mythid
62     & )
63     if (exf_yftype .eq. 'RL') then
64     call exf_filter_rl( lwflux1, lwfluxmask, mythid )
65     else
66     call exf_filter_rs( lwflux1, lwfluxmask, mythid )
67     end if
68     endif
69    
70     if (( first ) .or. ( changed )) then
71     call exf_SwapFFields( lwflux0, lwflux1, mythid )
72    
73     call mdsreadfield( lwfluxfile, exf_iprec, exf_yftype, 1
74     & , lwflux1, count1, mythid
75     & )
76     if (exf_yftype .eq. 'RL') then
77     call exf_filter_rl( lwflux1, lwfluxmask, mythid )
78     else
79     call exf_filter_rs( lwflux1, lwfluxmask, mythid )
80     end if
81     endif
82 heimbach 1.1
83     c Loop over tiles.
84 dimitri 1.4 do bj = mybylo(mythid),mybyhi(mythid)
85     do bi = mybxlo(mythid),mybxhi(mythid)
86     do j = 1,sny
87     do i = 1,snx
88 heimbach 1.1
89 dimitri 1.4 c Interpolate linearly onto the current time.
90 heimbach 1.1
91 dimitri 1.4 lwflux(i,j,bi,bj) = fac * lwflux0(i,j,bi,bj) +
92     & (exf_one - fac) *lwflux1(i,j,bi,bj)
93 heimbach 1.1
94 dimitri 1.4 enddo
95     enddo
96 heimbach 1.1 enddo
97 dimitri 1.4 enddo
98    
99     endif
100 heimbach 1.1
101 heimbach 1.2 #endif
102    
103 heimbach 1.1 end
104    
105    
106    
107 heimbach 1.2 subroutine exf_init_lwflux( mythid )
108 heimbach 1.1
109     c ==================================================================
110     c SUBROUTINE exf_init_lwflux
111     c ==================================================================
112     c
113     c o
114     c
115     c started: Ralf.Giering@FastOpt.de 25-Mai-2000
116 heimbach 1.2 c changed: heimbach@mit.edu 10-Jan-2002
117 heimbach 1.1 c
118     c ==================================================================
119     c SUBROUTINE exf_init_lwflux
120     c ==================================================================
121    
122     implicit none
123    
124     c == global variables ==
125    
126     #include "EEPARAMS.h"
127     #include "SIZE.h"
128    
129     #include "exf_param.h"
130 heimbach 1.2 #include "exf_fields.h"
131 heimbach 1.1
132     c == routine arguments ==
133    
134     integer mythid
135    
136 heimbach 1.2 #ifdef ALLOW_ATM_TEMP
137 heimbach 1.1 c == local variables ==
138    
139     integer bi, bj
140     integer i, j
141    
142     c == end of interface ==
143    
144     do bj = mybylo(mythid), mybyhi(mythid)
145     do bi = mybxlo(mythid), mybxhi(mythid)
146     do j = 1, sny
147     do i = 1, snx
148 heimbach 1.5 lwflux(i,j,bi,bj) = lwfluxconst
149 heimbach 1.1 lwflux0(i,j,bi,bj) = 0. _d 0
150     lwflux1(i,j,bi,bj) = 0. _d 0
151     enddo
152     enddo
153     enddo
154     enddo
155 heimbach 1.2
156     #endif
157 heimbach 1.1
158     end

  ViewVC Help
Powered by ViewVC 1.1.22