Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Computer Resources
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Monitor
Service Desk
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IMGW
Computer Resources
Commits
07a37350
Commit
07a37350
authored
2 years ago
by
Stefano Serafin
Browse files
Options
Downloads
Patches
Plain Diff
WRF.md conditional compilation
parent
c4533daf
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
WRF.md
+55
-0
55 additions, 0 deletions
WRF.md
with
55 additions
and
0 deletions
WRF.md
+
55
−
0
View file @
07a37350
...
...
@@ -333,9 +333,64 @@ This means:
1. When editing the source code, always work on the .F files, otherwise changes will be lost on the next compilation.
2. In the .F files, it is possible to include `#ifdef` and `#ifndef` directives for conditional compilation.
For instance, in `dyn_em/module_initialize_ideal.F`:
```
#ifdef MTN
DO j=max(ys,jds),min(ye,jde-1)
DO i=max(xs,ids),min(xe,ide-1)
grid%ht(i,j) = mtn_ht
* 0.25 *
&
( 1. + COS ( 2
*pi/(xe-xs) *
( i-xs ) + pi ) )
*
&
( 1. + COS ( 2
*pi/(ye-ys) *
( j-ys ) + pi ) )
ENDDO
ENDDO
#endif
#ifdef EW_RIDGE
DO j=max(ys,jds),min(ye,jde-1)
DO i=ids,ide
grid%ht(i,j) = mtn_ht
* 0.50 *
&
( 1. + COS ( 2
*pi/(ye-ys) *
( j-ys ) + pi ) )
ENDDO
ENDDO
#endif
#ifdef NS_RIDGE
DO j=jds,jde
DO i=max(xs,ids),min(xe,ide-1)
grid%ht(i,j) = mtn_ht
* 0.50 *
&
( 1. + COS ( 2
*pi/(xe-xs) *
( i-xs ) + pi ) )
ENDDO
ENDDO
#endif
#ifdef NS_VALLEY
DO i=ids,ide
DO j=jds,jde
grid%ht(i,j) = mtn_ht
ENDDO
ENDDO
xs=ids !-1
xe=xs + 20000./config_flags%dx
DO j=jds,jde
DO i=max(xs,ids),min(xe,ide-1)
grid%ht(i,j) = mtn_ht - mtn_ht
* 0.50 *
&
( 1. + COS ( 2
*pi/(xe-xs) *
( i-xs ) + pi ) )
ENDDO
ENDDO
#endif
```
To control conditional compilation:
1. Search for the variable `ARCHFLAGS` in `configure.wrf`
2. Add the desired define statement at the bottom
```
ARCHFLAGS = $(COREDEFS) -DIWORDSIZE=$(IWORDSIZE) -DDWORDSIZE=$(DWORDSIZE) -DRWORDSIZE=$(RWORDSIZE) -DLWORDSIZE=$(LWORDSIZE)
\
$(ARCH_LOCAL)
\
$(DA_ARCHFLAGS)
\
-DDM_PARALLEL
\
...
-DNMM_NEST=$(WRF_NMM_NEST)
\
-DNS_VALLEY
```
## Customizing model output
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment