Sie sind auf Seite 1von 12

USING POM IN CLIMATE AND OCEAN

ANALYSIS LABORATORY (COAL)

Prepared by

Liew Juneng

Climate and Ocean Analysis Laboratory


Marine Science Program
School of Environmental and Natural Resource Science
Faculty of Science and Technology
National University of Malaysia
1. Introduction

POM, acronym for Princeton Ocean Model is a community   coordinate ocean


circulation model developed by Blumberg and Mellor (1987). The original POM is a
box model and in order to use it for real data application, considerable modification to
the model code is required. Minimally, realistic bathymetry and coastline must be
supplied. This can be a difficult task as most of the students are not well equipped
with sufficient programming knowledge (especially FORTRAN). In order to use the
model effectively, students are encouraged to start learning FORTRAN and MATLAB
programming. In COAL we modified the version of POM which is supplied by the
Siam Meteorology Institute to facilitate hydrodynamic research by our members. This
version of POM uses the rectilinear grids. In order to simplify the processes in setting
up the modeling experiments, several preprocessing packages have been developed
(mostly in MATLAB). Ideally, students should be able to start the experiments
immediately and at the same time start to learn how to program both FORTRAN and
MATLAB effectively.

2. Requirement

To successfully compile SIAM-POM, one needs the GNU set of FORTRAN


compilers. However other suite of FORTRAN compilers may also be used with
minimal hack on the makefile in the $POM/src directory. The preprocessing scripts
are mainly developed in MATLAB. They are built on version 5.3 of MATLAB on
Win32 platform and is not tested on any UNIX platform. It is recommended that the
experiments are to be conducted on PHYTON (master only) while the pre-processing
can be done locally on Win32 PCs. Ideally, one should have the basic knowledge to
navigate around in a Linux environment and is capable to exchange files between
these two platforms. Users should also equipped with proper knowledge to analyze
and navigate around in GrADS environment.
Note: The latest version of this user guide can be obtained from the following
website:
http://www.ocean.ukm.my/people/juneng/doc/coal_pom_manual.pdf
OUTPUT

Depth
XLon TOPO
YLat

stress01.u MATLAB
stress02.u ATMOS_WUVSURF (Win32)
...
stress01.v
stress02.v
...
ATMOS_PRESS
press01
press02

TS
Ssig1.d
Ssig2.d Phyton
Ssig3.d (UNIX)
Ssig4.d
Tsig1.d
Tsig2.d POM
Tsig3.d
Tsig4.d
FIGURE 1. The schematic diagram showing the flow of pre-processing steps needed
to get all the data necessary for POM integration.

3. PREPARING INPUT DATA

3.1 Preparing The Topography (TOPO)

Fig 1 shows the flow chart depicting the procedure to setup POM experiments. The
first script users need to run is called bathymetry.m. As indicated in the name, the
script setup the proper domain of interest together with desired model resolution. To
use this script, the MATLAB mapping toolbox must be installed on local machine and
the associated ETOPO5 data must be properly installed in the correct directory of the
local machine. If you are not sure whether the ingredients are readily available to your
computer, contact COAL lab administrator. Copy the bathymetry.m to your working
directory (for convenience, user should create a unique folder which will be used to
store all the output files). Before running the script, modify the first few line of the
file to define your model domain and resolution:

orig_lon = 98.;
dlon = 0.1;
im = 160;
orig_lat = -5.0;
dlat = 0.1;
jm = 160;
orig_lon and orig_lat define the lower left corner of your domain while dlon and
dlat (in degree) define the resolution of your model. im and jm define the number of
grids in x- and y- direction.

Save and run the script. At the end of the execution, four output files will be created in
the running directory – Depth, Xlon, Ylat and depth.ctl. Depth, Xlon, Ylat are the
binary files and the depth.ctl is the GrADS control file for Depth. Users are
encouraged to view the output in GrADS. FTP both Depth and depth.ctl to Phyton.
Before executing GrADS, we need to transform the depth.ctl to UNIX format since
the ASCII is generated in the Win32 environment.
# dos2unix depth.ctl
# grads

Note that in this script all the bathymetry values are minus with 5 m (usually 10 m is
used according to some forum discussion I encountered) to make sure that all the sea
area are properly defined and there is no funny configuration occurred near the coastal
area. Users may want to save all the variables in the workspace for future use. Once
the user are satisfied with the domain setting, we are now ready to move to the next
procedure – ATMOS_WUVSURF.

3.2 Preparing The Surface Wind Stress Field (ATMOS_WUVSURF)

Like the bathymetry.m, the process to generate atmospheric forcing files must be
conducted under MATLAB (Win32) environment. Users need to prepare the wind
data and load the wind data into the MATLAB workspace accordingly. User can then
manually run the atmos_windforce (written as a MATLAB function!) to prepared the
wind stress field. This need to be done separately for every time step (e.g if you have
12-hourly data for 4 days, you need to run the function 8 times to get all the necessary
files). To ease the process, user are encouraged to write their own script to automate
the procedure.

The function atmos_windforce.m calls another function stress.m for surface wind
stress computation. The formula used is written as:-

 x  2 u A 
    ' C drag u A  v A  v 
2

 b  A
where
 air
'  and C drag the drag coefficient.
 water

In this case the C drag is computed as

2 2
C drag  5  10  4 [1.2 1  0.02  u A  v A
Note that a negative drag coefficient is used here (negative sign appended to  ' in
this case) for POM stress convention. Users are encouraged to read on the code
comments in the original stress.f in the SIAM-POM’s src directory. Further
description of this issue is also discussed in the POM’s FAQ page. If other empirical
formulations are to be used, user can modify the stress.m  to incorporate desired
formulation.

Following example shows how to utilize these functions/scripts to prepare the wind
stress forcing fields.

Example:

Change directory to the appropriate folder and load the demo surface wind field.

>>cd ../atmos_wuvsurf
>>load ATMOS_WIND_DEMO

The data is the 10m surface wind from FNL from 25 December 2001 to 28 December
2001 available at 1o  1o resolution and at an interval of 12 hours. Once loaded, user
should get these four variables in your MATLAB workspace:-

>>whos
  Name        Size         Bytes  Class

  lat         1x31           248  double array
  lon         1x41           328  double array
  uwind       8x31x41      81344  double array
  vwind       8x31x41      81344  double array

The lon and lat provide the coordinate on which the u- and v-wind components are
defined. User needs to generate a proper meshgrid (can be done easily) in order for
function atmos_windforce.m to work properly.

>>[lon, lat] = meshgrid (lon, lat);
>>whos
  Name        Size         Bytes  Class

  lat        31x41         10168  double array
  lon        31x41         10168  double array
  uwind      8x31x41       81344  double array
  vwind      8x31x41       81344  double array

The lat and lon should now become a 2D matrix with appropriate dimensionality.
User are encouraged to visually inspect the resulting variables to understand this
process entirely. Before we continue, make sure that you have the xlon and ylat
(output from bathymetry.m) in your MATLAB workspace. We need this two variables
to properly interpolate the uwind and vwind onto the model grid you have just created
with bathymetry.m. The surface wind data (uwind and vwind) span 4 days (12 hourly
each) from 00 UTC 25 December 2001 to 1800 UTC 28 December 2001, covering the
entire period of the landfalling Typhoon Vamei. In this case, users need to call
atmos_windforce.m eights times to obtain 16 surface wind stress files (8 for each x-
and y- direction). However users may invoke the following scripts to speed up the
process if the number of time steps become extremely large.

for t = 1 : 8
atmos_windforce(reshape(uwind(t,:,:),31,41), ...
reshape(vwind(t,:,:),31,41), ...
lon, lat, xlon, ylat, ['stress0' num2str(t)]);
end
Once executed, the working directory should contained 16 wind stress files.

>> ls stress*

stress.m   stress02.u stress03.v stress05.u stress06.v stress08.u 
stress01.u stress02.v stress04.u stress05.v stress07.u stress08.v 
stress01.v stress03.u stress04.v stress06.u stress07.v

Now you can FTP all the stress files onto your PHYTON working directory. Create
new directories to keep your folder neat. Execute

#cat stress0*.u > stress.u
#cat stress0*.v > stress.v

to join all the files into single file. Both stress.u and stress.v are the sequential
binaries that hold the wind stress field for total of eight time steps. If you want to
make sure the data is injected correctly, you can build a GrADS control files (each for
stress.u and stress.v). The control file may look like this for your stress.u:-

dset ^stress.u
title Processed wind stress (u­ component)
undef ­99999
xdef 160 linear 98 0.1
ydef 160 linear ­5 0.1
zdef 1 levels 200100
tdef 8 linear 00z25DEC2001 12HR
vars 1
wusurf 1 1 processed tau_u
endvars

Create CTL files for both stress.u and stress.v so that use can better visualize the result
in proper vector plots. POM only need stress.u and stress.v to run and all other files
may be removed to tidy up the working space (users are encouraged to do so).

3.3 Preparing The Surface Pressure Field (ATMOS_PRESS)

Preparing the surface pressure field is very similar to the procedure to obtain the
surface wind stress field. The MATLAB lines are written as a function and user may
need to write proper routine to automate the process entirely (users are encourage to
do so).

Change directory to the atmos_press directory where the pressure.m resides.


>>cd ../atmos_press
>>load ATMOS_PRESS_DEMO

The data is the mean sea level pressure (PMSLMSL) from NCEP final analyese from
00 UTC 25 December 2001 to 00 UTC 28 December 2001 available at 1o  1o
resolution and at an interval of 12 hours. Once loaded into the MATLAB
environment, user should get these three variables in your MATLAB workspace:-

>>whos
  
Name        Size         Bytes  Class

  lat         1x31           248  double array
  lon         1x41           328  double array
  press       8x31x41      81344  double array
  
Preparing the surface pressure field is very similar to processing the surface wind
stress field.

>>[lon, lat] = meshgrid (lon, lat);


>>whos
Name Size Bytes Class

lat 31x41 10168 double array


lon 31x41 10168 double array
press 8x31x41 81344 double array
>>
>>for t = 1 : 8
pressure(reshape(press(t,:,:),31,41), ...
lon, lat, xlon, ylat, ['press0' num2str(t)]);
end

Eight surface pressure field, one for each time steps will be created in the working
directory. Running this process the second time may required users to manually
removed the existing outputs from previous run.

>> ls press*

press01    press03    press05    press07    pressure.m 
press02    press04    press06    press08    

Note that the computation of atmospheric pressure forcing in POM is not directly in
unit Pa, but required a transformation using:-

( P  101200)
g 0

Where g is the gravity acceleration while  0  1025 . After collecting all the output,
now you can FTP all the press0* files onto your PHYTON working directory. Create
a new directories to keep your folder neat. Execute the command:

#cat press0*.u > press.d
to join all the files into a single file. The resulting press.d are the sequential binaries
that hold the pressure field data for total of eight time steps. User can now build a
GrADS control files to visualize and inspect the resulting binary. The control file may
look like this :-

dset ^press.d
title Surface Pressure
undef ­99999
xdef 160 linear 98 0.1
ydef 160 linear ­5 0.1
zdef 1 levels 200100
tdef 8 linear 00z25DEC2001 12HR
vars 1                                                   
press 1 1 Interpolated Pressure
endvars

POM need only press.d to run and all other files may be removed to tidy up the
working space (users are encouraged to do so).

3.4 Preparing The 3D Salinity and Temperature Field (TS)

Unlike the rest of the procedure, this procedure need to be accomplished on Linux
platform (Phyton) using the originally provided tools in SIAM-POM. However
porting this steps to MATLAB is already a work in progress and user will be able to
finish this final step in MATLAB easily in the near future.

In order to run these tools, user need to compile the SIAM-POM.

Login into Phyton and create a proper working directory under your home directory.

#mkdir POM_COAL
#cd POM_COAL

The original POM source code provided has several bugs and I have fixed several of
them. The source will always be examined for further possible flaws and the latest
source is always available at my webpage. User can get the source with the ‘wget’
utility under Linux.
#wget http://192.168.0.254/people/juneng/coal_pom.tar.gz
#tar zxvf coal_pom.tar.gz
#cd ./src
#vi config.h

For convenience, the working directory is referred as $POM here after. After
changing directory to the $POM/src folder, locate and modify the config.h. This is
the model configuration file which defined the model setup and will be included
during the compilation. Hence, the information parsed must be consistent with the
setting in bathymetry.m. Tipically these parameters must be consist with that in
bathymetry.m.

PARAMETER (IM=160,JM=160,KB=15)
DATA ORIG_LON/98.0/, DLON/0.1/
DATA ORIG_LAT/-5.0/, DLAT/0.1/

Save the modified file and we are ready to compile the model.

#make
#make install

Seeing the line,


cp pom dtg grid levitus sst press stress ../bin
cp libpom.a ../lib

indicating successful compilation and installation of the POM system.


#make clean

To clean up all the temporary files.

Now you are ready to interpolate the Levitus climatology (’94) to your model’s grid
(rectilinear in horizontal and sigma in vertical). User need to make sure Depth, Xlon
and Ylat is in $POM/dat

#cd ../dat
#ls –lhtr

and you should now see these files:-

-rw-rw-r-- 1 liew liew 255K Aug 6 16:03 etopo.d


-rw-rw-r-- 1 liew liew 16K Aug 6 16:03 land.sea
-rw-rw-r-- 1 liew liew 496K Aug 6 16:03 slev94.d
-rw-rw-r-- 1 liew liew 496K Aug 6 16:04 tlev94.d
-rw-rw-r-- 1 liew liew 100K Sep 26 18:43 Ylat
-rw-rw-r-- 1 liew liew 100K Sep 26 18:43 Xlon
-rw-rw-r-- 1 liew liew 100K Sep 26 18:43 Depth
-rw-rw-r-- 1 liew liew 208 Sep 26 18:43 Depth.ctl

#../bin/levitus >levitus.log

Your $POM/dat directory should now contains a few more Ssig* and Tsig* files.
-rw-rw-r-- 1 liew liew 1.5M Sep 26 18:46 Tsig3.d
-rw-rw-r-- 1 liew liew 1.5M Sep 26 18:46 Tsig2.d
-rw-rw-r-- 1 liew liew 1.5M Sep 26 18:46 Tsig1.d
-rw-rw-r-- 1 liew liew 1.5M Sep 26 18:46 Ssig3.d
-rw-rw-r-- 1 liew liew 1.5M Sep 26 18:46 Ssig2.d
-rw-rw-r-- 1 liew liew 1.5M Sep 26 18:46 Ssig1.d
-rw-rw-r-- 1 liew liew 1.5M Sep 26 18:46 Tsig4.d
-rw-rw-r-- 1 liew liew 1.5M Sep 26 18:46 Ssig4.d

Ssig1.d is the salinity for Jan-Feb-Mar, Ssig2.d is salinity for Apr-May-Jun, Ssig3.d is
salinity for Jul-Aug-Sep and Ssig4.d is salinity for Oct-Nov-Dec. Like for Tsig*.d for
the temperature field. Inspect the levitus.log to check for any error in case the process
failed. User may now gather all the necessary forcing files (include the atmospheric
wind stress and pressure) together in $POM/dat directory and ready to run the model.
4. Running POM on Phyton

Before users reach this step, make sure you have all the necessary ingredients ready. If
you have not, you may need to revise the steps described above. A full list of user’s
$POM/dat directory may look like this:-
-rw-rw-r-- 1 liew liew 100K Sep 26 18:43 Depth
-rw-rw-r-- 1 liew liew 208 Sep 26 18:43 Depth.ctl
-rw-rw-r-- 1 liew liew 255K Aug 6 16:03 etopo.d
-rw-rw-r-- 1 liew liew 16K Aug 6 16:03 land.sea
-rw-rw-r-- 1 liew liew 2.6K Sep 26 18:46 levitus.log
-rw-rw-r-- 1 liew liew 800K Sep 26 18:52 press.d
-rw-rw-r-- 1 liew liew 496K Aug 6 16:03 slev94.d
-rw-rw-r-- 1 liew liew 1.5M Sep 26 18:46 Ssig1.d
-rw-rw-r-- 1 liew liew 1.5M Sep 26 18:46 Ssig2.d
-rw-rw-r-- 1 liew liew 1.5M Sep 26 18:46 Ssig3.d
-rw-rw-r-- 1 liew liew 1.5M Sep 26 18:46 Ssig4.d
-rw-rw-r-- 1 liew liew 800K Sep 26 18:51 stress.u
-rw-rw-r-- 1 liew liew 800K Sep 26 18:51 stress.v
-rw-rw-r-- 1 liew liew 496K Aug 6 16:04 tlev94.d
-rw-rw-r-- 1 liew liew 1.5M Sep 26 18:46 Tsig1.d
-rw-rw-r-- 1 liew liew 1.5M Sep 26 18:46 Tsig2.d
-rw-rw-r-- 1 liew liew 1.5M Sep 26 18:46 Tsig3.d
-rw-rw-r-- 1 liew liew 1.5M Sep 26 18:46 Tsig4.d
-rw-rw-r-- 1 liew liew 100K Sep 26 18:43 Xlon
-rw-rw-r-- 1 liew liew 100K Sep 26 18:43 Ylat

go to the $POM/job directory


#cd ../job
#vi runpom

and modified the job file, runpom. For the Vamei (2001) case used in these example,
the following parameters are to be used:-
POM_BIN=/home/liew/POMSIAM-VAMEI/bin
POM_DAT=/home/liew/POMSIAM-VAMEI/dat
cd $POM_BIN
$POM_BIN/pom <<END_PARAM

&PARAM
LABEL = '-VAMEI2001',

HIST_FILE = 'none'
XFORC_FILE = '$POM_DAT/stress.u',
YFORC_FILE = '$POM_DAT/stress.v',
PRESS_FILE = '$POM_DAT/press.d',
SST_FILE = 'none',

DEPTH_FILE = '$POM_DAT/Depth',
TEMP_FILE = '$POM_DAT/Tsig4.d',
SALT_FILE = '$POM_DAT/Ssig4.d',

xpos = 100, 101, 102, 103, 104,


ypos = 8, 9, 8, 9, 8,

MODE = 2,
DAYS = 4,
DTE = 15.,
ISPLIT = 60,
FORC = 12,
DIAG = .TRUE.,
RAMP = 0.0,
PRTD = 1.0,
HORCON = 0.02,
VMAX = 100.,
ISPADV = 5 /
END_PARAM

The first two lines specify the FULL path to user’s $POM/bin as well as $POM/dat
directory.
LABEL = '-VAMEI2001',

gives a label to your run, which will usually be appended to your output file to
distinguish output from current run to the one from previous runs. The next few lines
specify where all the forcing files locate. Users need to refer to the official POM
manual to obtained the physical meaning of the rest of the parameters specified.
Particularly, the FORC=12 tells the model that the atmospheric forcing fields are to be
updated every 12 hours. If users want to run the model with constant forcing fields
(e.g for climatological forcings), user can setup the forcing fields with only single
time step and set the FORC to a very large value (e.g 5000).
Now run the model with the following line:-

#./runpom

If the executable is not workable, user may need to invoke following command:-

#chmod u+x runpom

The model should now run and there will be continuous screen dump to validate this.
Should the model fail to run, user may need to check the error message. A common
mistake here is the missing or specification of wrong path to the input forcing files. If
the model encountered instability, user can decrease the value of DTE.

The output of the model will be generated in the $POM/bin folder. The fact that the
output is placed in the $POM/bin result in a messy folder. User should manually
transfer all the output files into $POM/outp.

#cd ../outp
#cp ../bin/*VAMEI2001* .
#ls –lh

The default output for this run include only 3 model variables namely:

1. surface elevation ( e-VAMEI2001.*)


2. vertically averaged current speed in u- component (ua-VAMEI2001.*)
3. vertically averaged current speed in v- component (va-VAMEI2001.*)

The post-fixed numbers indicate the time the output is generated. In this case 001 is
the t = 1 h and 019 is the t =19 h output. If other variables are desired, user need to
modified the output.f in the $POM/src to uncomment the line pointing to that
variables. Once this is done, user need to recompile the model in order to get the
desired output.

Once all the output is in a single folder ($POM/outp), user can now view the
generated output and do necessary analysis using the GrADS. We first combine all the
file into a single sequential binary:

#cat e-VAMEI2001* >elev.dat


#cat ua-VAMEI2001* >ua.dat
#cat va-VAMEI2001* >va.dat

and then create GrADS control files for each of the binaries. The example of the
GrADS’s CTL – elev.ctl, ua.ctl and va.ctl is provided in $POM/outp. User need to
modify or write his/her own control files should they run their own case with different
model setup.

The manual describes the procedure to run the POM (SIAM version) using the pre-
processing package developed by the author. However this guide should not be treated
as the sole and only manual to run the POM model. User needs to read the official
userguide to understand the bolts and nuts of this complicated model. The example
given in this writing setups simulation which is forced at the surface solely by the
pressure and wind stress field and the model is initialized using the climatological TS.
However, user may also forces the ocean dynamic with various surface fluxes should
a longer simulation period is desired (variable climatology simulations). User should
also try to understand by themselves the following terminology frequently
encountered in running POM:-

 Mode=2, Mode=3 and Mode=4 (What are the main differences between them?)
 Barotropic mode (or external mode). What is going on in internal mode then?
 Timesplit/Mode split
 Sigma Coordinate, Arakawa-C grid. What is the benefit of using vertical sigma
coordinate?
 What are the approximations taken by POM?
 Turbulent Closure Model (usually referred to as Mellor-Yamada model). What is
the benefit of using this model? The process need not be parameterized instead.
This greatly the model capability to describe the mixing layer dynamic. However
the calculated mixing layer is usually shallower.
 Ratio DTI/DTE is roughly 50-80. DTE << DTI.
 User need to understand the POM calculation flow chart in the official POM
userguide.

Das könnte Ihnen auch gefallen