[Thread Prev][Thread Next][Index]

[ferret_users] Re: IF-ELIF-ELSE-ENDIF in a repeat loop



Thanks a lot for everyone who has replied.

It was due to a typo in the script.

My apology!

--- Peng

On Wed, Mar 28, 2018 at 11:40 AM, Ge Peng - NOAA Affiliate <ge.peng@xxxxxxxx> wrote:
Hi, 

I have the following script within a repeat loop:

IF  `ng_r_nz GE 1` THEN ;\

    let wk_new=IF sie_wk THEN  sie_wk ELSE (`nz_spvl`)  ;\   

ELIF `ng_r_zo GE 1` TEHN ;\

    let wk_new=IF sie_wk THEN  sie_wk ELSE (`zo_spvl`)  ;\

ELSE ;\

    let wk_new=IF sie_wk THEN  sie_wk ELSE (`ms_spvl`)  ;\

ENDIF ;\


I would like to set the missing data value to
       ->  nz_spvl if ng_r_nz >= 1
       ->  zo_spvl if ng_r_nz <1 but  ng_r_zo >= 1   
**ERROR: command syntax: Entire ELIF statement should be "ELIF expr THEN"

          ELIF 0 TEHN



What did I do wrong? 


The following link: ../../documentation/users-guide/commands-reference/IF

provides the following example:



--

Ge Peng, PhD
Research Scholar
Cooperative Institute for Climate and Satellites - NC (CICS-NC)/NCSU at

NOAA’s National Centers for Environmental Information (NCEI)

Center for Weather and Climate (CWC)

151 Patton Ave, Asheville, NC 28801
+1 828 257 3009; ge.peng@xxxxxxxx

ORCID: http://orcid.org/0000-0002-1986-9115

Following CICS-NC on Facebook






--

Ge Peng, PhD
Research Scholar
Cooperative Institute for Climate and Satellites - NC (CICS-NC)/NCSU at

NOAA’s National Centers for Environmental Information (NCEI)

Center for Weather and Climate (CWC)

151 Patton Ave, Asheville, NC 28801
+1 828 257 3009; ge.peng@xxxxxxxx

ORCID: http://orcid.org/0000-0002-1986-9115

Following CICS-NC on Facebook




[Thread Prev][Thread Next][Index]