-
Notifications
You must be signed in to change notification settings - Fork 6
/
main.f90
53 lines (45 loc) · 1.63 KB
/
main.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
program main
use mod_nc_reader
use mod_wrf_writer
implicit none
real, dimension(20, 30) :: fake_data
type(tp_wrf_data) :: wrf_data
type(tp_nc_data) :: nc_data
type(tp_nc_meta) :: nc_meta
character(len=100) :: out_file_name
nc_meta % file_name = "/short/public/sjj565/soil_moisture.nc"
nc_meta % var_name = "SM000010"
nc_meta % lat_name = "latitude"
nc_meta % lon_name = "longitude"
out_file_name = "Soil_Moisture.WRF"
!wrf_data %
call nc_read_data(nc_data, nc_meta)
! See http://www2.mmm.ucar.edu/wrf/users/docs/user_guide/users_guide_chap3.html#_Writing_Meteorological_Data
wrf_data%version = 5
call set_resolution(wrf_data, nc_data%nx, nc_data%ny)
wrf_data%iproj = 0 ! cylindrical equidistant
wrf_data%nlats = 0
wrf_data%xfcst = 0.0
wrf_data%xlvl = 0.0
wrf_data%startlat = nc_data%startlat
wrf_data%startlon = nc_data%startlon
wrf_data%deltalat = nc_data%deltalat
wrf_data%deltalon = nc_data%deltalon
wrf_data%dx = 5.0
wrf_data%dy = 5.0
wrf_data%xlonc = 0.0
wrf_data%truelat1 = 0.0
wrf_data%truelat2 = 0.0
wrf_data%earth_radius = 6371.0
call set_slab(wrf_data, nc_data%slab)
wrf_data%is_wind_grid_rel = .FALSE.
wrf_data%startloc = "SWCORNER"
wrf_data%field = "soilmoist"
wrf_data%hdate = "2008:01:01_00:00:00"
wrf_data%units = nc_data%units
wrf_data%map_source = "CSIRO Marine and Atmospheric Research"
wrf_data%desc = ""
print *, "lats: ", wrf_data%startlat, wrf_data%deltalat
print *, "lons: ", wrf_data%startlon, wrf_data%deltalon
call wrf_write(out_file_name, wrf_data)
end program main