source: trunk/LMDZ.MARS/libf/phymars/comgeomfi_h.F90 @ 1242

Last change on this file since 1242 was 1233, checked in by aslmd, 11 years ago

LMDZ.MARS. Filling geom arrays is now out of phys_var_state_init. Done through a merged function ini_fillgeom within the comgeomfi_h module. Cosmetic changes. New interface with the mesoscale model: lesser amount of dirty MESOSCALE includes.

File size: 1.7 KB
Line 
1
2       module comgeomfi_h
3
4       implicit none
5
6       ! These arrays are allocated in phys_state_var_init
7       REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: long ! longitudes (rad)
8       REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: lati ! latitudes (rad)
9       REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: area ! mesh area (m2)
10       REAL,SAVE :: totarea
11       REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: sinlon
12       REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: coslon
13       REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: sinlat
14       REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: coslat
15
16       contains
17
18         subroutine ini_comgeomfi_h(ngrid)
19
20         implicit none
21         integer,intent(in) :: ngrid ! number of atmospheric columns
22
23         allocate(lati(ngrid))
24         allocate(long(ngrid))
25         allocate(area(ngrid))
26         allocate(sinlat(ngrid))
27         allocate(coslat(ngrid))
28         allocate(sinlon(ngrid))
29         allocate(coslon(ngrid))
30
31         end subroutine ini_comgeomfi_h
32
33         subroutine ini_fillgeom(ngrid,plat,plon,parea)
34
35         implicit none
36         INTEGER,INTENT(IN) :: ngrid ! number of atmospheric columns
37         REAL,INTENT(IN) :: plat(ngrid),plon(ngrid),parea(ngrid)
38         EXTERNAL SSUM
39         REAL SSUM
40         integer :: ig
41
42         ! fill "comgeomfi_h" data
43         call SCOPY(ngrid,plon,1,long,1)
44         call SCOPY(ngrid,plat,1,lati,1)
45         call SCOPY(ngrid,parea,1,area,1)
46         totarea=SSUM(ngrid,area,1)
47         DO ig=1,ngrid
48            sinlat(ig)=sin(lati(ig))
49            coslat(ig)=cos(lati(ig))
50            sinlon(ig)=sin(long(ig))
51            coslon(ig)=cos(long(ig))
52         ENDDO
53
54         end subroutine ini_fillgeom
55
56       end module comgeomfi_h
57
Note: See TracBrowser for help on using the repository browser.