Opened 9 years ago

Closed 9 years ago

#780 closed help (fixed)

Relative vorticity mod for UM vn4.5

Reported by: rmbyoung Owned by: willie
Component: UM Model Keywords:
Cc: Platform:
UM Version: 4.5

Description

Hi,

I would like to output relative vorticity as a UM vn4.5 diagnostic and was wondering whether anyone has a mod to calculate it (and the appropriate user STASHmaster file)? I can probably work out how to do this myself but I thought perhaps someone has made one already as it was a little surprising the relative vorticity wasn't in the vn4.5 STASH list (I understand it was added in later versions?).

Thanks,

Roland

Change History (15)

comment:1 Changed 9 years ago by willie

  • Owner changed from um_support to willie
  • Status changed from new to accepted

Hi Roland,

The relative vorticity can be calculated after the UM has run, by using the mdiag program. See http://cms.ncas.ac.uk/index.php/tools-and-utilities/um-tools/1364.

I hope that helps,

regards

Willie

comment:2 Changed 9 years ago by rmbyoung

Hi Willie,

This looks promising, and I will try it, but I get the error

/tmp/lIND62fQ.bin.part could not be saved, because the source file could not be read.
Try again later, or contact the server administrator.

when clicking on either of the download links on that page (the filename varies) or the MDIAG.CONTROL.FULL link at the bottom of the page. Please can you check whether this is working?

Thanks,

Roland

comment:3 Changed 9 years ago by willie

Hi Roland,

They're all working for me. This could be a problem at your end. Do you have write permissions on the directory you're trying to download to?

Willie

comment:4 Changed 9 years ago by rmbyoung

It must be my machine (although I can download other things to the /tmp directory) as someone else can get the downloads to work. I'll give it a try.

Roland

comment:5 Changed 9 years ago by rmbyoung

Hi Willie,

I have the files now, but I cannot get the i386 version to work:

young@sherlock: MDIAG $ ls -l
total 3508
-rwxr-xr-x 1 young gfd 1048 Feb 1 13:28 MDIAG.CONTROL.FULL*
-rwxr-xr-x 1 young gfd 311580 Jan 31 16:35 mdiag design.pdf*
-rwxr-xr-x 1 young gfd 1809128 Jan 31 16:35 mdiag_i386*
-rwxr-xr-x 1 young gfd 1451084 Jan 31 16:35 mdiag_sparc*
young@sherlock: MDIAG $ mdiag_i386
-bash: ./mdiag_i386: No such file or directory

The webpage indicates that this command with no options should give some help text. I think the system architecture is compatible - if I try to run the mdiag_sparc executable (which I know isn't compatible) then I get

-bash: ./mdiag_sparc: cannot execute binary file

as expected for incompatible architecture. My uname -a output is

Linux sherlock 2.6.32-37-generic-pae #81-Ubuntu SMP Fri Dec 2 22:24:22 UTC 2011 i686 GNU/Linux

Is the source code available for this utility - perhaps it would work if I recompiled it on my system using the instructions in the design notes?

Roland

comment:6 Changed 9 years ago by willie

Hi Roland,

I've updated the web page and the source code is now available. Just unpack the tar file, decide which fortran compiler you are using and then type make. Let ne know if you have problems.

regards

Willie

comment:7 Changed 9 years ago by rmbyoung

Hi Willie,

Thanks very much; I'll download that and let you know how I get on. It turns out I would have had to recompile it anyway, as I am actually using the UM to model the giant planets rather than Earth, and so most of the constants in ALL_CONSTANTS.f90 are incorrect for me.

Roland

comment:8 Changed 9 years ago by rmbyoung

Hi Willie,

I can compile this ("make gfortran", standard flags) and run it, but I think my pp input is incorrectly formatted. I use convpp (I don't have ff2pp) to convert a standard UM start dump file (64-bit model) to pp. However, it behaves incorrectly when reading in the headers. When I add the line "write(*,*) ppheader" in PP_ROUTINES.f90 subroutine getGridTypeAndDimensions immediately after the "read(lun_mdiagin,iostat=stat) PPHEADER" line, the output I get suggests the pp header is being read in incorrectly:

"PP input file has 290 headers

2 0 9 0 10 0 3 0 0 0 250 0 1984 0 7 0 1 0 0 0 0 0 335 0 2 0 18240 0 65160 0 1 0 0 0 181 0 360 0 0 0 0 0 2 0 8 0.0000000 NaN NaN NaN NaN 1.80767502E-43 0.0000000 NaN NaN NaN NaN 2.86985925E-41 0.0000000 9.18354962E-41 0.0000000 NaN NaN 1.68155816E-44 0.0000000"

The timestamp for this dump is 0002/09/10 03:00, so it looks like there are additional zeroes between each variable. My only guess is that it is reading in N bytes per variable but the file is storing them in 2N bytes. If so, how can I get around it? I tried converting the file to 32-bit before running convpp, but I get convpp errors in that case:

"convpp xabgda.da029a3.32 xabgda.da029a3.32.pp

FILE STATUS
===========

OPEN: File xabgda.da029a3.32 to be Opened on Unit 20 Exists

SETPOS: Seek Failed: Invalid argument
SETPOS: Unit 20 to Word Address -1 Failed with Error Code -1
forrtl: error (76): Abort trap signal
Image PC Routine Line Source

Stack trace terminated abnormally."

Thanks,

Roland

comment:9 Changed 9 years ago by willie

Hi Roland,

I think you have to use 'convpp -32' to convert from 64 bit fields file to 32 bit PP files.

I hope that helps

regards,

Willie

comment:10 Changed 9 years ago by rmbyoung

Hi Willie,

The version I have doesn't permit that option:

"convpp -32 xabgda.da029a3 xabgda.da029a3.pp

/home/jupiter/gfd/young/um64p/um/vn4.5/utils/convpp: Usage is /home/jupiter/gfd/young/um64p/um/vn4.5/utils/convpp -uSTASH ustsnum file 1 file 2"

I am using the 4.5 01/09/98 version supplied with the UM vn4.5.

Best wishes,

Roland

comment:11 Changed 9 years ago by willie

Hi Roland

I have put a version of ff2pp in my home directory /home/willie on PUMA. This is for a Linux x86_64 system, so this will work on PUMA.

Regards,

Willie

comment:12 Changed 9 years ago by rmbyoung

Hi Willie,

ff2pp works fine - thanks.

I have made some progress but I think the best way forward is to include relative vorticity as a new diagnostic within STASH. The main problem is that because I am using the UM in a non-standard way, not all the required mdiag input diagnostics are available. Some of the missing diagnostics (e.g. the humidity/cloud quantities) I think I can replace with other STASH output with minor editing of the mdiag source code, but the main issue is that none of the diagnostics that output T on the model grid are available to me (as the precipitation, radiation, convection, and other physics routines are either disabled or completely rewritten); I can only get it on the pressure grid. I tried editing the mdiag code to account for this but this was messy and I couldn't get it to work.

In principle I could code a user STASHmaster file and mod to generate T on the model grid as a new diagnostic. But if that is required then I might as well just do that for the relative vorticity, particularly as now I have the mdiag source code which should calculate it correctly, and I also have the various user STASHmaster-related mods like ars1f405 supplied with the portable UM to guide me in adding it.

This will certainly be a cleaner solution, and I am comfortable editing the UM itself. Furthermore, I will also save a lot of disk space by calculating vorticity within the UM, as I do not need most of the diagnostics required by mdiag as input anyway (especially as some of them are just full of zeros, as I don't use the humidity variable).

I'll let you know how I get on.

Thanks,

Roland

comment:13 Changed 9 years ago by rmbyoung

Hi Willie,

I have coded a relative vorticity mod and user STASHmaster file and got it to work.

One question - when I view the output using xconv, my new diagnostic is listed as "Stash code = 15250" instead of "RELATIVE VORTICITY ON PRESSURE LEVS.", the name I gave it in the user STASHmaster file. When I run pumf on the output, this field is described as "NON-STANDARD FIELD". Is it possible to have this named as I would like in the output, or am I just going to have to remember what STASH code 15/250 stands for?

Thanks,

Roland

comment:14 Changed 9 years ago by willie

Hi Roland,

Glad you got it working. Xconv only knows about things in the STASH master file, so anything in your user STASH file is ignored.

Regards

Willie

comment:15 Changed 9 years ago by willie

  • Resolution set to fixed
  • Status changed from accepted to closed
Note: See TracTickets for help on using tickets.