[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

20010220: Calculating moisture flux divergence



>From: "Paul L. Sirvatka" <address@hidden>
>Organization: College of DuPage
>Keywords: 200102162013.f1GKD9L01250 McIDAS-X SFCCON GRDDISP

Paul,

>OK....here is the program that should work.

OK, I'll take a look.

>IGU DEL 21
>EG 4 6
>
>
>SFCCON MIX SURFACEMAP LATEST OUT=SAVE MYDATA/GRIDS.21
>SFCCON STREAML SURFACEMAP LATEST OUT=SAVE MYDATA/GRIDS.21
>
>REM This is Moisture FLux Divergence
>GRDDISP MYDATA/GRIDS.21 4 MAP=SURFACEMAP G1='PARAM MIX' G2='PARAM U'
>G3='PARAM V' NEWPAR=MDVG GKGS SFC
>MATH='(G1*(DDX(G2)+DDY(G3))+G2*(DDX(G1))+G3*(DDY(G1))*36000)'CINT=2
>DASH=POS FORMAT=F4
>
>REM This is moisture advection
>GRDDISP MYDATA/GRIDS.21 5 MAP=SURFACEMAP G1='PARAM MIX' G2='PARAM U'
>G3='PARAM V' NEWPAR=MADV GKGH SFC MATH='((G2*DDX(G1) + G3*DDY(G1))*36000)'
>DASH=POS CINT=2 FORMAT=F4
>
>REM This is moisture*divergence
>GRDDISP MYDATA/GRIDS.21 6 MAP=SURFACEMAP G1='PARAM MIX' G2='PARAM U'
>G3='PARAM V' NEWPAR=MDIV GKGH SFC MATH='((G1*(DDX(G2) + DDY(G3)))*36000)'
>DASH=POS CINT=2 FORMAT=F4

>The first one is the definition of Moisture flus divergence which is a sum
>of moisture advection and moisture time divergence.
>
>When you run this...I would guess that it is frame 4 = fr 5 + fr 6.
>It is not. And I do not know why the answers are so different!

I copied your script into a file (TEST.BAT) in my McIDAS working directory
and then ran it.  I agree that 'frame 4 = fr 5 + fr 6' should be the
result, but is not.

I took a harder look at your first function and I think I see the problem:

MATH= from equation 1:

(G1*(DDX(G2)+DDY(G3))+G2*(DDX(G1))+G3*(DDY(G1))*36000)

Splitting the terms out, we get:

G1*(DDX(G2)+DDY(G3))

G2*(DDX(G1))+G3*(DDY(G1))*36000

Note that the 36000 is multiplying G3*(DDY(G1)) _only_.  Somewhere one
or more parentheses got dropped.

MATH= from equation 2 is:

((G2*DDX(G1) + G3*DDY(G1))*36000)

In this, 36000 multiplies the sum of (G2*DDX(G1) + G3*DDY(G1))

MATH= from equation 3 is:

((G1*(DDX(G2) + DDY(G3)))*36000)

In this, 36000 multiplies the sum of (G1*(DDX(G2) + DDY(G3)))

So, I think that the MATH= in equation 1 should be:

((G1*(DDX(G2)+DDY(G3))+G2*DDX(G1)+G3*DDY(G1))*36000)

I made this change and I think I get 'frame 4 = fr 5 + fr 6'.
Please make the same change in your script; run it; and let me know
if you don't agree.

>Also...this is not the same that MCIDAS with MDVG from SFCPLT works.

Let's revisit this after you update the MATH= clause in your script
and rerun it.

>I am very frustrated now. Can you help?

I hope that your problem was one or more missing parentheses.

>Also...i keep losing my image window. Is it a bug in McIDAS or in my
>x-windows.

Can you tell me how this happens?  Is something in particular running
when it happens?  If so, what?  I think that it might be a problem
in Xwindows, but it might be a program crapping out.  I found one
such bug in McIDAS-X 7.6 and fixed it some time ago.

>Also how do you see the end of the lines with > at the end?

You have two options for the Text and Command window:

o grab either side with the mouse and make the window wider
o you can use the ALT-] key sequence to scroll the Text and Command window
  contents to the right and the ALT-[ key sequence to scroll to the left

>Thanks

What operating system are you running on?  Also, what version of McIDAS
are you using?  I ask so that I can better contemplate the image window
disappearance problem.

Tom