| 1 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
|---|
| 2 | MODULE module_model_basics |
|---|
| 3 | |
|---|
| 4 | integer :: west_east_dim, south_north_dim, bottom_top_dim |
|---|
| 5 | integer :: iprogram |
|---|
| 6 | character (len=1) :: vertical_type |
|---|
| 7 | |
|---|
| 8 | integer :: map_proj |
|---|
| 9 | real :: dx, dy, cen_lat, moad_cen_lat, cen_lon, stand_lon |
|---|
| 10 | real :: truelat1, truelat2 |
|---|
| 11 | character (len=128) :: title |
|---|
| 12 | |
|---|
| 13 | real :: PTOP |
|---|
| 14 | real, allocatable, dimension(:) :: ZNU, ZNW |
|---|
| 15 | real, allocatable, dimension(:,:) :: XLAT, XLONG, HGT |
|---|
| 16 | real, allocatable, dimension(:,:) :: U10, V10 |
|---|
| 17 | real, allocatable, dimension(:,:) :: PSFC |
|---|
| 18 | real, allocatable, dimension(:,:) :: MU, MUB |
|---|
| 19 | real, allocatable, dimension(:,:,:) :: P, PB, PH, PHB, PRES !! PRES is pressure in Pa |
|---|
| 20 | real, allocatable, dimension(:,:,:) :: UUU, VVV, T, TK !! TK is temp in K, T is theta-300 |
|---|
| 21 | real, allocatable, dimension(:,:,:) :: QV, QR, QS, QG |
|---|
| 22 | |
|---|
| 23 | logical :: have_PTOP |
|---|
| 24 | logical :: have_ZNU, have_ZNW |
|---|
| 25 | logical :: have_XLAT, have_XLONG, have_HGT |
|---|
| 26 | logical :: have_U10, have_V10 |
|---|
| 27 | logical :: have_PSFC |
|---|
| 28 | logical :: have_MU, have_MUB |
|---|
| 29 | logical :: have_P, have_PB, have_PH, have_PHB, have_PRES |
|---|
| 30 | logical :: have_UUU, have_VVV, have_T, have_TK |
|---|
| 31 | logical :: have_QV, have_QR, have_QS, have_QG |
|---|
| 32 | |
|---|
| 33 | CONTAINS |
|---|
| 34 | |
|---|
| 35 | FUNCTION virtual (tmp,rmix) |
|---|
| 36 | ! This function returns virtual temperature in K, given temperature |
|---|
| 37 | ! in K and mixing ratio in kg/kg. |
|---|
| 38 | |
|---|
| 39 | real :: tmp, rmix, virtual |
|---|
| 40 | |
|---|
| 41 | virtual=tmp*(0.622+rmix)/(0.622*(1.+rmix)) |
|---|
| 42 | |
|---|
| 43 | END FUNCTION virtual |
|---|
| 44 | |
|---|
| 45 | |
|---|
| 46 | END MODULE module_model_basics |
|---|