-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
first pass at allocatable arrays (does not compile)
- Loading branch information
Austin Blevins
committed
Nov 30, 2022
1 parent
cfc0929
commit 902c8da
Showing
16 changed files
with
166 additions
and
48 deletions.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| !********************************************************************************************************************************** | ||
| ! | ||
| ! Unit Name : util_pop | ||
| ! Unit Type : function | ||
| ! Project : CTEM | ||
| ! Language : Fortran 2003 | ||
| ! | ||
| ! Description : Popped a old regolith block onto an old surface | ||
| ! | ||
| ! | ||
| ! Input | ||
| ! Arguments : regolayer :: pointer to the top of the regolith stack | ||
| ! oldlayer :: old layer to pop off of the top of the stack | ||
| ! | ||
| ! Output | ||
| ! Arguments : | ||
| ! | ||
| ! | ||
| ! Notes : | ||
| ! | ||
| !********************************************************************************************************************************** | ||
| subroutine util_pop_array(regolayer,oldregodata) | ||
| use module_globals | ||
| use module_util, EXCEPT_THIS_ONE => util_pop_array | ||
| implicit none | ||
|
|
||
| ! Arguments | ||
| type(regodatatype),dimension(:),allocatable :: regolayer | ||
| type(regodatatype),intent(out) :: oldregodata | ||
|
|
||
| ! Internal variables | ||
| type(regodatatype), dimension(:), allocatable :: newlayer | ||
| integer(I4B) :: allocstat | ||
| integer(I4B) :: nold | ||
|
|
||
| ! Executable code | ||
|
|
||
| nold = size(regolayer) | ||
|
|
||
| allocate(newlayer(nold-1), stat=allocstat) | ||
| newlayer(1:nold-1) = regolayer(1:nold-1) ! could also be 2:nold depending on if top or bottom is popped off | ||
| call move_alloc(newlayer, regolayer) | ||
| end subroutine util_pop_array |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| !********************************************************************************************************************************** | ||
| ! | ||
| ! Unit Name : util_push_array | ||
| ! Unit Type : subroutine | ||
| ! Project : CTEM | ||
| ! Language : Fortran 2003 | ||
| ! | ||
| ! Description : Pushes a new regolith block onto an old surface | ||
| ! | ||
| ! | ||
| ! Input | ||
| ! Arguments : regolayer :: allocatable array | ||
| ! newregodata :: new layer to push onto the top of the stack | ||
| ! | ||
| ! Output | ||
| ! Arguments : | ||
| ! | ||
| ! | ||
| ! Notes : | ||
| ! | ||
| !********************************************************************************************************************************** | ||
| subroutine util_push_array(regolayer,newregodata) | ||
| use module_globals | ||
| use module_util, EXCEPT_THIS_ONE => util_push_array | ||
| implicit none | ||
|
|
||
| ! Arguments | ||
| type(regodatatype),dimension(:),allocatable :: regolayer | ||
| type(regodatatype),dimension(:),allocatable :: newregodata | ||
|
|
||
| ! Internal variables | ||
| type(regodatatype), dimension(:), allocatable :: newlayer | ||
| integer(I4B) :: allocstat | ||
| integer(I4B) :: nold | ||
|
|
||
| ! Executable code | ||
|
|
||
| nold = size(regolayer) | ||
|
|
||
| allocate(newregodata(nold+1), stat=allocstat) | ||
| newlayer(1:nold) = regolayer(1:nold) | ||
| newlayer(nold+1) = newregodata(:) ! need to see if this adds to the top or bottom of the layer stack | ||
| call move_alloc(newlayer, regolayer) | ||
| end subroutine util_push_array | ||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters