PROGRAM test_fluxtable C PURPOSE: Used to test the flux table (flux_table.f). C Shows the structure of the main program and calling C sequence of include files and subroutines. C - The correct calling sequence greatly C improves the time efficiency of the flux table. C This is important when incorporting the flux table C into a larger model. C - The steps for using the flux table are labeled C in sequential order below IMPLICIT NONE C (1) Access the COMMON block using the 'include' statement C C - COMMON block is used to store the flux table data C and associated transfer coefficients include "flux.inc" C (2) Declare and define input/output variables for the flux table C - If no input data file then follow (2a) C - If reading input data file then follow (2b) C - Input variables: 'u' wind speed [m/s] C 'v' wind speed [m/s] C sea surface temperature [Celsius] C air temperature [Celsius] C reference height [m] C significant wave height [m] C 'u' orbital velocity [m/s] C 'v' orbital velocity [m/s] C specific humidity (surface) [kg/kg] C specific humidity (ref. height) [kg/kg] C surface pressure [Pa] C - Output variables: 'u' component of stress [N/m^2] C 'v' component of stress [N/m^2] C sensible heat flux [W/m^2] C latent heat flux [W/m^2] C (2a) C REAL u,v,sst,at,ref_height,Hsig,u_orb,v_orb,qs,q,press C REAL tau_u,tau_v,shf,lhf C u = 15.7 C v = 0.0 C sst = 6.1 C at = 5.2 C ref_height = 10.0 C Hsig = 0.0 C u_orb = 0.0 C v_orb = 0.0 C qs = 0.006 C q = 0.005 C press = 101325.0 C (2b) If input data being read then call your read subroutine C (e.g. read_your_data.f) C - Input variables not being read in must be defined INTEGER i,dim PARAMETER (dim=51) REAL u(dim),v,sst(dim),at(dim),ref_height REAL Hsig,u_orb,v_orb,qs(dim),q(dim),press REAL tau_u,tau_v,shf,lhf REAL tauu_out(dim),tauv_out(dim),shf_out(dim),lhf_out(dim) C Variables not read in are defined as follows v = 0.0 ref_height = 10.0 u_orb = 0.0 v_orb = 0.0 Hsig = 0.0 press = 101325.0 C Read input data CALL read_your_data(u,at,qs,q,sst) C (3) Call subroutine (read_data.f) to read in flux table data C and associated transfer coefficients CALL read_data C (4) Call flux table (flux_table.f) C - If (2a) then follow (4a) C - If (2b) then follow (4b) C - Output variables: 'u' stress [N/m^2] C 'v' stress [N/m^2] C sensible heat flux [W/m^2] C latent heat flux [W/m^2] C (4a) C CALL flux_table(u,v,sst,at,ref_ht,Hsig,u_orb,v_orb,qs,q, C + press,tau_u,tau_v,shf,lhf) C Print output (u-stress, v-stress, shf, lhf) C PRINT*, 'tau_u = ', tau_u C PRINT*, 'tau_v = ', tau_v C PRINT*, 'shf = ', shf C PRINT*, 'lhf = ', lhf C (4b) DO 50 i=1,51 CALL flux_table(u(i),v,sst(i),at(i),ref_height, + Hsig,u_orb,v_orb,qs(i),q(i),press, + tau_u,tau_v,shf,lhf) C Output from flux table (e.g. u-stress, v-stress, shf, and lhf) C - In this example output variables are written to a C file (output.dat) for comparison purposes tauu_out(i) = tau_u tauv_out(i) = tau_v shf_out(i) = shf lhf_out(i) = lhf 50 CONTINUE OPEN(UNIT=20, file='output.dat', STATUS='NEW') DO 60 i=1,51 WRITE(20,*) i,tauu_out(i),shf_out(i),lhf_out(i) 60 CONTINUE CLOSE (UNIT=20) END