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
RevLine 
[1047]1
2       module comgeomfi_h
3
4       implicit none
5
[1224]6       ! These arrays are allocated in phys_state_var_init
[1130]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)
[1047]10       REAL,SAVE :: totarea
[1224]11       REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: sinlon
12       REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: coslon
13       REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: sinlat
14       REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: coslat
[1047]15
[1224]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))
[1233]26         allocate(sinlat(ngrid))
27         allocate(coslat(ngrid))
28         allocate(sinlon(ngrid))
29         allocate(coslon(ngrid))
[1224]30
31         end subroutine ini_comgeomfi_h
32
[1233]33         subroutine ini_fillgeom(ngrid,plat,plon,parea)
[1224]34
35         implicit none
[1233]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
[1224]40         integer :: ig
41
[1233]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)
[1224]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
[1233]54         end subroutine ini_fillgeom
55
[1047]56       end module comgeomfi_h
57
Note: See TracBrowser for help on using the repository browser.