| [1047] | 1 | |
|---|
| 2 | module comgeomfi_h |
|---|
| 3 | |
|---|
| 4 | implicit none |
|---|
| 5 | |
|---|
| [1224] | 6 | ! These arrays are allocated in phys_state_var_init |
|---|
| [1541] | 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 |
|---|
| [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 | |
|---|
| [1541] | 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 | |
|---|
| [1770] | 33 | |
|---|
| 34 | subroutine end_comgeomfi_h |
|---|
| 35 | |
|---|
| 36 | implicit none |
|---|
| 37 | |
|---|
| 38 | if (allocated(sinlat)) deallocate(sinlat) |
|---|
| 39 | if (allocated(coslat)) deallocate(coslat) |
|---|
| 40 | if (allocated(sinlon)) deallocate(sinlon) |
|---|
| 41 | if (allocated(coslon)) deallocate(coslon) |
|---|
| 42 | |
|---|
| 43 | end subroutine end_comgeomfi_h |
|---|
| 44 | |
|---|
| [1233] | 45 | subroutine ini_fillgeom(ngrid,plat,plon,parea) |
|---|
| [1224] | 46 | |
|---|
| 47 | implicit none |
|---|
| [1233] | 48 | INTEGER,INTENT(IN) :: ngrid ! number of atmospheric columns |
|---|
| 49 | REAL,INTENT(IN) :: plat(ngrid),plon(ngrid),parea(ngrid) |
|---|
| 50 | EXTERNAL SSUM |
|---|
| 51 | REAL SSUM |
|---|
| [1224] | 52 | integer :: ig |
|---|
| 53 | |
|---|
| [1233] | 54 | ! fill "comgeomfi_h" data |
|---|
| [1541] | 55 | ! call SCOPY(ngrid,plon,1,long,1) |
|---|
| 56 | ! call SCOPY(ngrid,plat,1,lati,1) |
|---|
| 57 | ! call SCOPY(ngrid,parea,1,area,1) |
|---|
| 58 | ! totarea=SSUM(ngrid,area,1) |
|---|
| [1224] | 59 | DO ig=1,ngrid |
|---|
| [1541] | 60 | sinlat(ig)=sin(plat(ig)) |
|---|
| 61 | coslat(ig)=cos(plat(ig)) |
|---|
| 62 | sinlon(ig)=sin(plon(ig)) |
|---|
| 63 | coslon(ig)=cos(plon(ig)) |
|---|
| [1224] | 64 | ENDDO |
|---|
| 65 | |
|---|
| [1233] | 66 | end subroutine ini_fillgeom |
|---|
| 67 | |
|---|
| [1047] | 68 | end module comgeomfi_h |
|---|
| 69 | |
|---|