Opened 5 years ago

Closed 5 years ago

#810 closed bug (WorksForMe)

Error where ROMS reads in specific humidity in bulk_flux.F?

Reported by: likerice Owned by:
Priority: minor Milestone: Release ROMS/TOMS 3.7
Component: Nonlinear Version: 3.7
Keywords: Cc:

Description

I am a relatively inexperienced ROMS user so my apologies if I am in error here. I recently updated my ROMS code to the most recent version and was surprised to find the following code intact:

!  Compute specific humidity, Q (kg/kg).
!
          IF (RH.lt.2.0_r8) THEN                       !RH fraction
            cff=cff*RH                                 !Vapor pres (mb)
            Q(i)=0.62197_r8*(cff/(PairM-0.378_r8*cff)) !Spec hum (kg/kg)
          ELSE          !RH input was actually specific humidity in g/kg
            Q(i)=RH/1000.0_r8                          !Spec Hum (kg/kg)
          END IF

I believe that the two blocks of code in the if/else statement should be swapped. Note that this block of code is the subject of several posts on the roms forum, e.g.: https://www.myroms.org/forum/viewtopic.php?f=3&t=2333

As John Wilkin explains in that post on the forum, this piece of legacy code appears to check whether the user inputs relative humidity (in %) or specific humidity (in g/kg). If "RH" < 2, ROMS concludes that the user has provided specific humidity in g/kg, but in that case it should go to the "else" statement and divide RH by 1000 to obtain Q in kg/kg.

If the user has provided relative humidity in per cent, then ROMS executes the code in the "else" block, but that is the case where ROMS should execute the code in the "if" block.

Tom

Change History (2)

comment:1 by likerice, 5 years ago

I have thought some more about this and now think the code is correct. I got confused because I think the explanation by John Wilkin in the linked message board post is wrong.

What I think the code is doing is just what it says, the IF block is for when the user provides relative humidity, and the ELSE block is for specific humidity (g/kg). I think the cutoff at 2.0 is because in practice, specific humidity is rarely < 2.0 g/kg over the ocean. This would only occur over extremely cold water.

Tom

comment:2 by arango, 5 years ago

Resolution: WorksForMe
Status: newclosed

The code in bulk_flux.F is correct. Indeed, the test for specific and relative humidity is quite clever. It was in the original COARE code. It is not something that I came up. I had to do some research on it many years ago.

Note: See TracTickets for help on using tickets.